equal
deleted
inserted
replaced
441 return 80 |
441 return 80 |
442 |
442 |
443 def makedir(path, notindexed): |
443 def makedir(path, notindexed): |
444 os.mkdir(path) |
444 os.mkdir(path) |
445 |
445 |
446 def unlinkpath(f): |
446 def unlinkpath(f, ignoremissing=False): |
447 """unlink and remove the directory if it is empty""" |
447 """unlink and remove the directory if it is empty""" |
448 os.unlink(f) |
448 try: |
|
449 os.unlink(f) |
|
450 except OSError, e: |
|
451 if not (ignoremissing and e.errno == errno.ENOENT): |
|
452 raise |
449 # try removing directories that might now be empty |
453 # try removing directories that might now be empty |
450 try: |
454 try: |
451 os.removedirs(os.path.dirname(f)) |
455 os.removedirs(os.path.dirname(f)) |
452 except OSError: |
456 except OSError: |
453 pass |
457 pass |