Mercurial > hg
comparison tests/hghave @ 28047:863075fd4cd0
misc: use modern exception syntax
This is fixing for 'legacy exception syntax; use "as" instead of ","'
check-code rule.
check-code has overlooked these, because files aren't recognized as
one to be checked (this problem is fixed by subsequent patch).
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Wed, 10 Feb 2016 22:44:29 +0900 |
parents | 05e7f57c74ac |
children | 544444991c83 |
comparison
equal
deleted
inserted
replaced
28046:742cf5b979ec | 28047:863075fd4cd0 |
---|---|
18 failed = 0 | 18 failed = 0 |
19 for name, feature in checks.iteritems(): | 19 for name, feature in checks.iteritems(): |
20 check, _ = feature | 20 check, _ = feature |
21 try: | 21 try: |
22 check() | 22 check() |
23 except Exception, e: | 23 except Exception as e: |
24 print "feature %s failed: %s" % (name, e) | 24 print "feature %s failed: %s" % (name, e) |
25 failed += 1 | 25 failed += 1 |
26 return failed | 26 return failed |
27 | 27 |
28 parser = optparse.OptionParser("%prog [options] [features]") | 28 parser = optparse.OptionParser("%prog [options] [features]") |
43 return | 43 return |
44 | 44 |
45 sys.path.insert(0, path) | 45 sys.path.insert(0, path) |
46 try: | 46 try: |
47 import hghaveaddon | 47 import hghaveaddon |
48 except BaseException, inst: | 48 except BaseException as inst: |
49 sys.stderr.write('failed to import hghaveaddon.py from %r: %s\n' | 49 sys.stderr.write('failed to import hghaveaddon.py from %r: %s\n' |
50 % (path, inst)) | 50 % (path, inst)) |
51 sys.exit(2) | 51 sys.exit(2) |
52 sys.path.pop(0) | 52 sys.path.pop(0) |
53 | 53 |