comparison contrib/check-py3-compat.py @ 49204:3f9125db466f stable

check-py3-compat: use an absolute path in sys.path The idea and rationale is similar to https://phab.mercurial-scm.org/D12599 (landed as 1b6e381521c5). Differential Revision: https://phab.mercurial-scm.org/D12621
author Anton Shestakov <av6@dwimlabs.net>
date Wed, 04 May 2022 13:48:40 +0400
parents c102b704edb5
children 13dfad0f9f7a
comparison
equal deleted inserted replaced
49202:2d0e22171ef9 49204:3f9125db466f
103 # importing that. When running standalone (not as part of a test), this 103 # importing that. When running standalone (not as part of a test), this
104 # means we actually import the installed versions, not the files we just 104 # means we actually import the installed versions, not the files we just
105 # specified. When running as test-check-py3-compat.t, we technically 105 # specified. When running as test-check-py3-compat.t, we technically
106 # would import the correct paths, but it's cleaner to have both cases 106 # would import the correct paths, but it's cleaner to have both cases
107 # use the same import logic. 107 # use the same import logic.
108 sys.path.insert(0, '.') 108 sys.path.insert(0, os.getcwd())
109 fn = check_compat_py3 109 fn = check_compat_py3
110 110
111 for f in sys.argv[1:]: 111 for f in sys.argv[1:]:
112 with warnings.catch_warnings(record=True) as warns: 112 with warnings.catch_warnings(record=True) as warns:
113 fn(f) 113 fn(f)