Show More
@@ -863,9 +863,11 b' class opener(object):' | |||||
863 | nlink = nlinks(f) |
|
863 | nlink = nlinks(f) | |
864 | except OSError: |
|
864 | except OSError: | |
865 | nlink = 0 |
|
865 | nlink = 0 | |
866 |
d = os.path. |
|
866 | dirname, basename = os.path.split(f) | |
867 | if not os.path.isdir(d): |
|
867 | # Avoid calling makedirs when the path points to a | |
868 | makedirs(d, self.createmode) |
|
868 | # directory -- the open will raise IOError below. | |
|
869 | if basename and not os.path.isdir(dirname): | |||
|
870 | makedirs(dirname, self.createmode) | |||
869 | if atomictemp: |
|
871 | if atomictemp: | |
870 | return atomictempfile(f, mode, self.createmode) |
|
872 | return atomictempfile(f, mode, self.createmode) | |
871 | if nlink > 1: |
|
873 | if nlink > 1: |
General Comments 0
You need to be logged in to leave comments.
Login now