It's better to ask forgiveness than permission. Just try to create
parent directories for any data file, and don't error if they
already exist.
):
# make parent directories if necessary
- if not os.path.exists(os.path.dirname(self.source)):
- old_umask = os.umask(normal_umask)
- os.makedirs(os.path.dirname(self.source))
- os.umask(old_umask)
+ old_umask = os.umask(normal_umask)
+ os.makedirs(os.path.dirname(self.source), exist_ok=True)
+ os.umask(old_umask)
# backup the file
if "mudpy.limit" in self.universe.contents: