Remove tuple unpacking from except clause contrib/RHEL4/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:49:39 +02:00 committed by Tomas Babej
parent 3459607410
commit 334be8c9cc

View File

@ -29,13 +29,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+")