scripts: Fix generator on Windows with Python < 3.6
This commit is contained in:
@@ -516,10 +516,9 @@ class OutputGenerator:
|
|||||||
# Generator can be used without writing to a file.
|
# Generator can be used without writing to a file.
|
||||||
if self.genOpts.filename is not None:
|
if self.genOpts.filename is not None:
|
||||||
if sys.platform == 'win32':
|
if sys.platform == 'win32':
|
||||||
directory = Path(self.genOpts.directory)
|
if not os.path.exists(self.genOpts.directory):
|
||||||
if not os.path.exists(directory):
|
|
||||||
os.makedirs(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:
|
else:
|
||||||
filename = self.genOpts.directory + '/' + self.genOpts.filename
|
filename = self.genOpts.directory + '/' + self.genOpts.filename
|
||||||
self.outFile = io.open(filename, 'w', encoding='utf-8')
|
self.outFile = io.open(filename, 'w', encoding='utf-8')
|
||||||
|
|||||||
Reference in New Issue
Block a user