# HG changeset patch # User Yuya Nishihara # Date 2016-11-01 12:14:33 # Node ID 389cbfe63586d2b4c53e3220fcc01b211906ba85 # Parent cac4ca036dff882c71f48f3130b72597d3e1fc64 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. diff --git a/tests/hghave.py b/tests/hghave.py --- a/tests/hghave.py +++ b/tests/hghave.py @@ -360,6 +360,11 @@ def has_rmcwd(): return False finally: os.chdir(ocwd) + # clean up temp dir on platforms where cwd can't be removed + try: + os.rmdir(temp) + except OSError: + pass @check("tla", "GNU Arch tla client") def has_tla():