diff options
author | Conley Owens <cco3@android.com> | 2012-10-25 10:03:36 -0700 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2012-10-25 10:03:37 -0700 |
commit | 608aff7f624e35348ff9fab74bad1d6921944238 (patch) | |
tree | e1bdbb8af5927dd226d8e22dc382fd24c4cdfa5e /main.py | |
parent | 13657c407d0424d0866993bea39ed01094caa1c1 (diff) | |
parent | a5be53f9c809009e67f217c00b8f30246aacc237 (diff) | |
download | git-repo-608aff7f624e35348ff9fab74bad1d6921944238.tar.gz |
Merge "Use modern Python exception syntax"
Diffstat (limited to 'main.py')
-rwxr-xr-x | main.py | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -146,13 +146,13 @@ class _Repo(object): | |||
146 | else: | 146 | else: |
147 | print >>sys.stderr, 'real\t%dh%dm%.3fs' \ | 147 | print >>sys.stderr, 'real\t%dh%dm%.3fs' \ |
148 | % (hours, minutes, seconds) | 148 | % (hours, minutes, seconds) |
149 | except DownloadError, e: | 149 | except DownloadError as e: |
150 | print >>sys.stderr, 'error: %s' % str(e) | 150 | print >>sys.stderr, 'error: %s' % str(e) |
151 | return 1 | 151 | return 1 |
152 | except ManifestInvalidRevisionError, e: | 152 | except ManifestInvalidRevisionError as e: |
153 | print >>sys.stderr, 'error: %s' % str(e) | 153 | print >>sys.stderr, 'error: %s' % str(e) |
154 | return 1 | 154 | return 1 |
155 | except NoSuchProjectError, e: | 155 | except NoSuchProjectError as e: |
156 | if e.name: | 156 | if e.name: |
157 | print >>sys.stderr, 'error: project %s not found' % e.name | 157 | print >>sys.stderr, 'error: project %s not found' % e.name |
158 | else: | 158 | else: |
@@ -390,14 +390,14 @@ def _Main(argv): | |||
390 | close_ssh() | 390 | close_ssh() |
391 | except KeyboardInterrupt: | 391 | except KeyboardInterrupt: |
392 | result = 1 | 392 | result = 1 |
393 | except RepoChangedException, rce: | 393 | except RepoChangedException as rce: |
394 | # If repo changed, re-exec ourselves. | 394 | # If repo changed, re-exec ourselves. |
395 | # | 395 | # |
396 | argv = list(sys.argv) | 396 | argv = list(sys.argv) |
397 | argv.extend(rce.extra_args) | 397 | argv.extend(rce.extra_args) |
398 | try: | 398 | try: |
399 | os.execv(__file__, argv) | 399 | os.execv(__file__, argv) |
400 | except OSError, e: | 400 | except OSError as e: |
401 | print >>sys.stderr, 'fatal: cannot restart repo after upgrade' | 401 | print >>sys.stderr, 'fatal: cannot restart repo after upgrade' |
402 | print >>sys.stderr, 'fatal: %s' % e | 402 | print >>sys.stderr, 'fatal: %s' % e |
403 | result = 128 | 403 | result = 128 |