1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-09-07 13:48:43 +02:00

Raise a ValueError if neither fn nor fh is passed to Ar.__init__

A ValueError is more appropriate because there is no issue with the
ar archive itself. Also, the old codepath never worked because the
fn parameter was missing.
This commit is contained in:
Marcus Huewe
2019-01-15 17:09:00 +01:00
parent 6fdce86fc9
commit b26a4a967d

View File

@@ -101,7 +101,7 @@ class Ar:
def __init__(self, fn = None, fh = None):
if fn == None and fh == None:
raise ArError('either \'fn\' or \'fh\' must be != None')
raise ValueError('either \'fn\' or \'fh\' must be != None')
if fh != None:
self.__file = fh
self.__closefile = False