Mercurial > hg
comparison mercurial/posix.py @ 31538:e6d4cc29fd60
posix: use local reference to removedirs
We have a local reference to os.removedirs in module scope, but we still used
os.removedirs inside functions. This changes util to use the local reference,
which will pave the way for combining duplicated code in future patches.
author | Ryan McElroy <rmcelroy@fb.com> |
---|---|
date | Tue, 21 Mar 2017 06:50:28 -0700 |
parents | c6cbe5720353 |
children | 52361c4f4dac |
comparison
equal
deleted
inserted
replaced
31537:c6cbe5720353 | 31538:e6d4cc29fd60 |
---|---|
543 except OSError as e: | 543 except OSError as e: |
544 if not (ignoremissing and e.errno == errno.ENOENT): | 544 if not (ignoremissing and e.errno == errno.ENOENT): |
545 raise | 545 raise |
546 # try removing directories that might now be empty | 546 # try removing directories that might now be empty |
547 try: | 547 try: |
548 os.removedirs(os.path.dirname(f)) | 548 removedirs(os.path.dirname(f)) |
549 except OSError: | 549 except OSError: |
550 pass | 550 pass |
551 | 551 |
552 def lookupreg(key, name=None, scope=None): | 552 def lookupreg(key, name=None, scope=None): |
553 return None | 553 return None |