diff options
author | Brian Dolbec <brian.dolbec@gmail.com> | 2011-03-26 20:39:37 -0700 |
---|---|---|
committer | Brian Dolbec <brian.dolbec@gmail.com> | 2011-03-26 20:39:37 -0700 |
commit | d0339cb228c16eb491d489a2276e254bacb41c81 (patch) | |
tree | bb61cdb2189c44f0742646ae7e75c5b0b87ba396 /layman/db.py | |
parent | e14906b88ec2da99dba82d565d88ed5ca1d40099 (diff) | |
download | layman-d0339cb228c16eb491d489a2276e254bacb41c81.tar.gz layman-d0339cb228c16eb491d489a2276e254bacb41c81.tar.bz2 layman-d0339cb228c16eb491d489a2276e254bacb41c81.zip |
migrate except ... as
Diffstat (limited to 'layman/db.py')
-rw-r--r-- | layman/db.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/layman/db.py b/layman/db.py index ed2bb2e..6e3cba4 100644 --- a/layman/db.py +++ b/layman/db.py @@ -303,7 +303,7 @@ class RemoteDB(DbBase): if not os.path.exists(os.path.dirname(mpath)): try: os.makedirs(os.path.dirname(mpath)) - except OSError, error: + except OSError as error: raise OSError('Failed to create layman storage direct' + 'ory ' + os.path.dirname(mpath) + '\n' + 'Error was:' + str(error)) @@ -312,7 +312,7 @@ class RemoteDB(DbBase): # file is intact and can be parsed try: self.read(olist, origin=url) - except Exception, error: + except Exception as error: raise IOError('Failed to parse the overlays list fetched fr' 'om ' + url + '\nThis means that the download' 'ed file is somehow corrupt or there was a pr' @@ -325,12 +325,12 @@ class RemoteDB(DbBase): out_file.write(olist) out_file.close() - except Exception, error: + except Exception as error: raise IOError('Failed to temporarily cache overlays list in' ' ' + mpath + '\nError was:\n' + str(error)) - except IOError, error: + except IOError as error: self.output.warn('Failed to update the overlay list from: ' + url + '\nError was:\n' + str(error)) |