mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-27 07:06:13 +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
|
print >>sys.stderr, 'Link cannot be expanded:\n', e
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
except oscerr.UnreadableFile, e:
|
|
||||||
print >>sys.stderr, e.msg
|
|
||||||
return 1
|
|
||||||
|
|
||||||
except (oscerr.NoWorkingCopy, oscerr.WorkingCopyWrongVersion), e:
|
except (oscerr.NoWorkingCopy, oscerr.WorkingCopyWrongVersion), e:
|
||||||
print >>sys.stderr, e
|
print >>sys.stderr, e
|
||||||
return 1
|
return 1
|
||||||
|
@ -970,9 +970,8 @@ class Package:
|
|||||||
elif not exists and exists_in_store and not known_by_meta:
|
elif not exists and exists_in_store and not known_by_meta:
|
||||||
state = 'D'
|
state = 'D'
|
||||||
elif not exists and not exists_in_store and not known_by_meta:
|
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
|
# this case shouldn't happen (except there was a typo in the filename etc.)
|
||||||
print >>sys.stderr, 'this code path should never be reached!'
|
raise IOError('osc: \'%s\' is not under version control' % n)
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
return state
|
return state
|
||||||
|
|
||||||
@ -1840,8 +1839,7 @@ def read_meta_from_spec(specfile, *args):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
if not os.path.isfile(specfile):
|
if not os.path.isfile(specfile):
|
||||||
msg = 'File \'%s\' is not a readable file' % specfile
|
raise IOError('\'%s\' is not a regular file' % specfile)
|
||||||
raise oscerr.UnreadableFile, msg
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
lines = codecs.open(specfile, 'r', locale.getpreferredencoding()).readlines()
|
lines = codecs.open(specfile, 'r', locale.getpreferredencoding()).readlines()
|
||||||
|
@ -74,11 +74,6 @@ class WorkingCopyOutdated(OscBaseError):
|
|||||||
class LinkExpandError(OscBaseError):
|
class LinkExpandError(OscBaseError):
|
||||||
"""Exception raised when source link expansion fails"""
|
"""Exception raised when source link expansion fails"""
|
||||||
|
|
||||||
class UnreadableFile(OscBaseError):
|
|
||||||
def __init__(self, msg):
|
|
||||||
OscBaseError.__init__(self)
|
|
||||||
self.msg = msg
|
|
||||||
|
|
||||||
class OscIOError(OscBaseError):
|
class OscIOError(OscBaseError):
|
||||||
def __init__(self, e, msg):
|
def __init__(self, e, msg):
|
||||||
OscBaseError.__init__(self)
|
OscBaseError.__init__(self)
|
||||||
|
Loading…
Reference in New Issue
Block a user