scripts: Fix generator on Windows with Python < 3.6

This commit is contained in:
Lenny Komow 2019-04-08 16:14:05 -06:00
parent 87837fcd42
commit 08cbb5458f

View File

@ -516,10 +516,9 @@ class OutputGenerator:
# Generator can be used without writing to a file.
if self.genOpts.filename is not None:
if sys.platform == 'win32':
directory = Path(self.genOpts.directory)
if not os.path.exists(directory):
if not os.path.exists(self.genOpts.directory):
os.makedirs(directory)
self.outFile = io.open(directory / self.genOpts.filename, 'w', encoding='utf-8')
self.outFile = io.open(self.genOpts.directory + '/' + self.genOpts.filename, 'w', encoding='utf-8')
else:
filename = self.genOpts.directory + '/' + self.genOpts.filename
self.outFile = io.open(filename, 'w', encoding='utf-8')