1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-13 09:16:14 +01:00

- renamed "RuntimeError" to "ExtRuntimeError" to avoid confusion with python's "RuntimeError" class

just a "cosmetic" changes
This commit is contained in:
Marcus Huewe 2010-08-16 16:27:00 +02:00
parent 03ad610caf
commit e209766084
4 changed files with 8 additions and 8 deletions

View File

@ -141,7 +141,7 @@ def run(prg):
print >>sys.stderr, e
return 2
except oscerr.RuntimeError, e:
except oscerr.ExtRuntimeError, e:
print >>sys.stderr, e.msg
return 1

View File

@ -2932,7 +2932,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
msg = edit_message()
try:
Project(arg).commit(msg=msg, validators=validators, verbose_validation=verbose_validation)
except oscerr.RuntimeError, e:
except oscerr.ExtRuntimeError, e:
print >>sys.stderr, "ERROR: source_validator failed", e
return 1
args.remove(arg)
@ -2983,13 +2983,13 @@ Please submit there instead, or use --nodevelproject to force direct submission.
for prj, packages in prj_paths.iteritems():
try:
Project(prj).commit(tuple(packages), msg=msg, files=files, validators=validators, verbose_validation=verbose_validation)
except oscerr.RuntimeError, e:
except oscerr.ExtRuntimeError, e:
print >>sys.stderr, "ERROR: source_validator failed", e
return 1
for pac in single_paths:
try:
Package(pac).commit(msg, validators=validators, verbose_validation=verbose_validation)
except oscerr.RuntimeError, e:
except oscerr.ExtRuntimeError, e:
print >>sys.stderr, "ERROR: source_validator failed", e
return 1
else:

View File

@ -940,7 +940,7 @@ class Package:
else:
p = subprocess.Popen([fn], close_fds=True)
if p.wait() != 0:
raise oscerr.RuntimeError(p.stdout, validator )
raise oscerr.ExtRuntimeError(p.stdout, validator )
have_conflicts = False
for filename in self.todo:
@ -2669,7 +2669,7 @@ def run_pager(message):
try:
subprocess.call('%s %s' % (pager, tmpfile.name), shell=True)
except OSError, e:
raise oscerr.RuntimeError('cannot run pager \'%s\': %s' % (pager, e.strerror), pager)
raise oscerr.ExtRuntimeError('cannot run pager \'%s\': %s' % (pager, e.strerror), pager)
finally:
tmpfile.close()
@ -2680,7 +2680,7 @@ def run_editor(filename):
try:
return subprocess.call(cmd)
except OSError, e:
raise oscerr.RuntimeError('cannot run editor \'%s\': %s' % (editor, e.strerror), editor)
raise oscerr.ExtRuntimeError('cannot run editor \'%s\': %s' % (editor, e.strerror), editor)
def edit_message(footer='', template='', templatelen=30):
delim = '--This line, and those below, will be ignored--\n'

View File

@ -41,7 +41,7 @@ class NoConfigfile(OscBaseError):
self.file = fname
self.msg = msg
class RuntimeError(OscBaseError):
class ExtRuntimeError(OscBaseError):
"""Exception raised when there is a runtime error of an external tool"""
def __init__(self, msg, fname):
OscBaseError.__init__(self)