mirror of
https://github.com/openSUSE/osc.git
synced 2025-08-06 15:43:39 +02:00
added some exception handling stuff to checkRevision() (thanks darix for the tip)
This commit is contained in:
13
osc/core.py
13
osc/core.py
@@ -1640,7 +1640,14 @@ def checkRevision(prj, pac, revision):
|
||||
"""
|
||||
check if revision is valid revision
|
||||
"""
|
||||
if int(revision) > int(show_upstream_rev(conf.config['apiurl'], prj, pac)):
|
||||
try:
|
||||
if int(revision) > int(show_upstream_rev(conf.config['apiurl'], prj, pac)):
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
except ValueError, ee:
|
||||
print >>sys.stderr, ee
|
||||
return False
|
||||
except TypeError, ee:
|
||||
print >>sys.stderr, ee
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
|
Reference in New Issue
Block a user