Show More
@@ -16,6 +16,7 samestat = os.path.samestat | |||
|
16 | 16 | oslink = os.link |
|
17 | 17 | unlink = os.unlink |
|
18 | 18 | rename = os.rename |
|
19 | removedirs = os.removedirs | |
|
19 | 20 | expandglobs = False |
|
20 | 21 | |
|
21 | 22 | umask = os.umask(0) |
@@ -59,6 +59,7 posixfile = platform.posixfile | |||
|
59 | 59 | quotecommand = platform.quotecommand |
|
60 | 60 | readpipe = platform.readpipe |
|
61 | 61 | rename = platform.rename |
|
62 | removedirs = platform.removedirs | |
|
62 | 63 | samedevice = platform.samedevice |
|
63 | 64 | samefile = platform.samefile |
|
64 | 65 | samestat = platform.samestat |
@@ -270,7 +270,7 def groupname(gid=None): | |||
|
270 | 270 | If gid is None, return the name of the current group.""" |
|
271 | 271 | return None |
|
272 | 272 | |
|
273 |
def |
|
|
273 | def removedirs(name): | |
|
274 | 274 | """special version of os.removedirs that does not remove symlinked |
|
275 | 275 | directories or junction points if they actually contain files""" |
|
276 | 276 | if osutil.listdir(name): |
@@ -297,7 +297,7 def unlinkpath(f, ignoremissing=False): | |||
|
297 | 297 | raise |
|
298 | 298 | # try removing directories that might now be empty |
|
299 | 299 | try: |
|
300 |
|
|
|
300 | removedirs(os.path.dirname(f)) | |
|
301 | 301 | except OSError: |
|
302 | 302 | pass |
|
303 | 303 |
General Comments 0
You need to be logged in to leave comments.
Login now