mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 21:55:41 -04:00
Bugfix for Python 3.4
This commit is contained in:
parent
05afc55a88
commit
a6c095c4e9
1 changed files with 2 additions and 1 deletions
|
|
@ -91,7 +91,8 @@ class Operator(metaclass=ABCMeta):
|
|||
def __enter__(self):
|
||||
# Save current directory and move to specific output directory
|
||||
self._orig_dir = os.getcwd()
|
||||
self.settings.output_dir.mkdir(exist_ok=True)
|
||||
if not self.settings.output_dir.exists():
|
||||
self.settings.output_dir.mkdir() # exist_ok parameter is 3.5+
|
||||
|
||||
# In Python 3.6+, chdir accepts a Path directly
|
||||
os.chdir(str(self.settings.output_dir))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue