except Ex, e: --> except Ex as e:

Nudge us towards python3 compatability by converting deprecated python2 syntax.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This commit is contained in:
Sebastian Spaeth
2012-02-05 10:14:23 +01:00
parent 7f22d89872
commit 0844d27f9f
12 changed files with 36 additions and 36 deletions

View File

@ -257,7 +257,7 @@ class MaildirFolder(BaseFolder):
try:
fd = os.open(os.path.join(tmpdir, messagename),
os.O_EXCL|os.O_CREAT|os.O_WRONLY, 0666)
except OSError, e:
except OSError as e:
if e.errno == 17:
#FILE EXISTS ALREADY
severity = OfflineImapError.ERROR.MESSAGE
@ -313,7 +313,7 @@ class MaildirFolder(BaseFolder):
try:
os.rename(os.path.join(self.getfullname(), oldfilename),
os.path.join(self.getfullname(), newfilename))
except OSError, e:
except OSError as e:
raise OfflineImapError("Can't rename file '%s' to '%s': %s" % (
oldfilename, newfilename, e[1]),
OfflineImapError.ERROR.FOLDER)