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:
parent
8c443fb8cc
commit
61f38b4268
1 changed files with 2 additions and 1 deletions
3
smem
3
smem
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue