Mercurial > hg-stable
comparison contrib/hg-ssh @ 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 | f68ded00cae5 |
children | 77eaf9539499 |
comparison
equal
deleted
inserted
replaced
28046:742cf5b979ec | 28047:863075fd4cd0 |
---|---|
50 os.path.expanduser(path))) | 50 os.path.expanduser(path))) |
51 for path in args] | 51 for path in args] |
52 orig_cmd = os.getenv('SSH_ORIGINAL_COMMAND', '?') | 52 orig_cmd = os.getenv('SSH_ORIGINAL_COMMAND', '?') |
53 try: | 53 try: |
54 cmdargv = shlex.split(orig_cmd) | 54 cmdargv = shlex.split(orig_cmd) |
55 except ValueError, e: | 55 except ValueError as e: |
56 sys.stderr.write('Illegal command "%s": %s\n' % (orig_cmd, e)) | 56 sys.stderr.write('Illegal command "%s": %s\n' % (orig_cmd, e)) |
57 sys.exit(255) | 57 sys.exit(255) |
58 | 58 |
59 if cmdargv[:2] == ['hg', '-R'] and cmdargv[3:] == ['serve', '--stdio']: | 59 if cmdargv[:2] == ['hg', '-R'] and cmdargv[3:] == ['serve', '--stdio']: |
60 path = cmdargv[2] | 60 path = cmdargv[2] |