py3: do not use "except Exception, e:" syntax

If catching the exception is done with "except Exception as e:" this
will work only from 2.6. To maintain backward compatibility with 2.4 I
have used sys.exc_info(). A bit of a wart, but it works.
This commit is contained in:
Oren Tirosh 2015-05-15 12:52:02 -05:00
commit 8f2294477c

3
smem
View file

@ -725,7 +725,8 @@ try:
showsystem()
else:
showpids()
except IOError, e:
except IOError:
_, e, _ = sys.exc_info()
if e.errno == errno.EPIPE:
pass
except KeyboardInterrupt: