Remove tuple unpacking from except clause ipa-client/ipaclient/ipachangeconf.py

Python 3 doesn't support tuple unpacking in except clauses. All implicit
tuple unpackings have been replaced with explicit unpacking of e.args.

https://fedorahosted.org/freeipa/ticket/5120

Reviewed-By: Tomas Babej <tbabej@redhat.com>
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
This commit is contained in:
Christian Heimes 2015-07-14 10:50:04 +02:00 committed by Tomas Babej
parent 334be8c9cc
commit feb8891dd0

View File

@ -31,13 +31,13 @@ def openLocked(filename, perms):
fd = os.open(filename, os.O_RDWR | os.O_CREAT, perms)
fcntl.lockf(fd, fcntl.LOCK_EX)
except OSError, (errno, strerr):
except OSError as e:
if fd != -1:
try:
os.close(fd)
except OSError:
pass
raise IOError(errno, strerr)
raise IOError(e.errno, e.strerror)
return os.fdopen(fd, "r+")