mirror of
https://github.com/openSUSE/osc.git
synced 2024-11-10 06:46:15 +01:00
- fixed #469167 (don't scare users if they want to commit a nonexistent file ;) )
- removed class UnreadableFile: I don't know why it was introduced at all but it doesn't make any sense => use IOError instead
This commit is contained in:
parent
0dc31b96b7
commit
c3136c8bf5
@ -77,10 +77,6 @@ def run(prg):
|
||||
print >>sys.stderr, 'Link cannot be expanded:\n', e
|
||||
return 1
|
||||
|
||||
except oscerr.UnreadableFile, e:
|
||||
print >>sys.stderr, e.msg
|
||||
return 1
|
||||
|
||||
except (oscerr.NoWorkingCopy, oscerr.WorkingCopyWrongVersion), e:
|
||||
print >>sys.stderr, e
|
||||
return 1
|
||||
|
@ -970,9 +970,8 @@ class Package:
|
||||
elif not exists and exists_in_store and not known_by_meta:
|
||||
state = 'D'
|
||||
elif not exists and not exists_in_store and not known_by_meta:
|
||||
print >>sys.stderr, '%s: not exists and not exists_in_store and not nown_by_meta' % n
|
||||
print >>sys.stderr, 'this code path should never be reached!'
|
||||
sys.exit(1)
|
||||
# this case shouldn't happen (except there was a typo in the filename etc.)
|
||||
raise IOError('osc: \'%s\' is not under version control' % n)
|
||||
|
||||
return state
|
||||
|
||||
@ -1840,8 +1839,7 @@ def read_meta_from_spec(specfile, *args):
|
||||
"""
|
||||
|
||||
if not os.path.isfile(specfile):
|
||||
msg = 'File \'%s\' is not a readable file' % specfile
|
||||
raise oscerr.UnreadableFile, msg
|
||||
raise IOError('\'%s\' is not a regular file' % specfile)
|
||||
|
||||
try:
|
||||
lines = codecs.open(specfile, 'r', locale.getpreferredencoding()).readlines()
|
||||
|
@ -74,11 +74,6 @@ class WorkingCopyOutdated(OscBaseError):
|
||||
class LinkExpandError(OscBaseError):
|
||||
"""Exception raised when source link expansion fails"""
|
||||
|
||||
class UnreadableFile(OscBaseError):
|
||||
def __init__(self, msg):
|
||||
OscBaseError.__init__(self)
|
||||
self.msg = msg
|
||||
|
||||
class OscIOError(OscBaseError):
|
||||
def __init__(self, e, msg):
|
||||
OscBaseError.__init__(self)
|
||||
|
Loading…
Reference in New Issue
Block a user