Mercurial > hg-stable
comparison tests/hghave.py @ 30242:389cbfe63586 stable
hghave: fix 'rmcwd' to ensure temporary directory is removed
On platforms where cwd can't be removed, it should try rmdir() after chdir
to the original cwd.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Tue, 01 Nov 2016 21:14:33 +0900 |
parents | 46a0203dfb89 |
children | d4db88a26ad5 |
comparison
equal
deleted
inserted
replaced
30241:cac4ca036dff | 30242:389cbfe63586 |
---|---|
358 return True | 358 return True |
359 except OSError: | 359 except OSError: |
360 return False | 360 return False |
361 finally: | 361 finally: |
362 os.chdir(ocwd) | 362 os.chdir(ocwd) |
363 # clean up temp dir on platforms where cwd can't be removed | |
364 try: | |
365 os.rmdir(temp) | |
366 except OSError: | |
367 pass | |
363 | 368 |
364 @check("tla", "GNU Arch tla client") | 369 @check("tla", "GNU Arch tla client") |
365 def has_tla(): | 370 def has_tla(): |
366 return matchoutput('tla --version 2>&1', br'The GNU Arch Revision') | 371 return matchoutput('tla --version 2>&1', br'The GNU Arch Revision') |
367 | 372 |