Skip to content

Commit

Permalink
Fix --buildonly with an existing directory (#178)
Browse files Browse the repository at this point in the history
exist_ok was introduced in Python 3.2.

Also no need to obtain the length of the directory name.
  • Loading branch information
cjmayo authored Oct 19, 2020
1 parent 5cfc242 commit af11dae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fract4d/fractmain.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ def compile(self, options):

def buildonly(self, options, outfile):
outdirname = os.path.dirname(options.buildonly)
if len(outdirname) > 0:
os.makedirs(outdirname)
if outdirname:
os.makedirs(outdirname, exist_ok=True)

shutil.copy(outfile, options.buildonly)
(base, ext) = os.path.splitext(outfile)
Expand Down

0 comments on commit af11dae

Please sign in to comment.