diff options
author | emkael <emkael@tlen.pl> | 2018-02-23 16:26:37 +0100 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2018-02-23 16:26:37 +0100 |
commit | 4f83ab2780bbe79784ecfbe0530f7f4dda102f10 (patch) | |
tree | 4abad2b87d8119ee78512fe4ec1bb68f1314840b /jfr_playoff/filemanager.py | |
parent | 17cd057a947772e04fa2ab731b87b1f4fff52da5 (diff) |
Attempt output path creation only if there's a non-empty path
Diffstat (limited to 'jfr_playoff/filemanager.py')
-rw-r--r-- | jfr_playoff/filemanager.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/jfr_playoff/filemanager.py b/jfr_playoff/filemanager.py index 6392ac9..97f9cb8 100644 --- a/jfr_playoff/filemanager.py +++ b/jfr_playoff/filemanager.py @@ -26,8 +26,9 @@ class PlayoffFileManager(object): def write_content(self, content): output_dir = os.path.dirname(self.output_file) - if not os.path.exists(output_dir): - os.makedirs(output_dir) + if len(output_dir) > 0: + if not os.path.exists(output_dir): + os.makedirs(output_dir) output = open(self.output_file, 'w') output.write(content.encode('utf8')) output.close() @@ -37,8 +38,9 @@ class PlayoffFileManager(object): def copy_scripts(self, script_path='sklady/playoff.js'): script_output_path = os.path.join(self.output_path, script_path) script_output_dir = os.path.dirname(script_output_path) - if not os.path.exists(script_output_dir): - os.makedirs(script_output_dir) + if len(script_output_dir) > 0: + if not os.path.exists(script_output_dir): + os.makedirs(script_output_dir) shutil.copy( unicode(os.path.join( os.path.dirname(__main__.__file__), 'playoff.js')), |