Mercurial > hg
comparison tests/test-remotefilelog-bundle2-legacy.t @ 50928:d718eddf01d9
safehasattr: drop usage in favor of hasattr
The two functions should now be equivalent at least in their usage in core.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Thu, 31 Aug 2023 23:56:15 +0200 |
parents | 68b7faeb6ef3 |
children |
comparison
equal
deleted
inserted
replaced
50927:7a8ea1397816 | 50928:d718eddf01d9 |
---|---|
9 > from mercurial import changegroup, registrar, util | 9 > from mercurial import changegroup, registrar, util |
10 > cmdtable = {} | 10 > cmdtable = {} |
11 > command = registrar.command(cmdtable) | 11 > command = registrar.command(cmdtable) |
12 > @command('testcg2', norepo=True) | 12 > @command('testcg2', norepo=True) |
13 > def testcg2(ui): | 13 > def testcg2(ui): |
14 > if not util.safehasattr(changegroup, 'cg2packer'): | 14 > if not hasattr(changegroup, 'cg2packer'): |
15 > sys.exit(80) | 15 > sys.exit(80) |
16 > EOF | 16 > EOF |
17 $ cat >> $HGRCPATH << EOF | 17 $ cat >> $HGRCPATH << EOF |
18 > [extensions] | 18 > [extensions] |
19 > testcg2 = $TESTTMP/testcg2.py | 19 > testcg2 = $TESTTMP/testcg2.py |