Commit 6b511bd9 authored by yonghong-song's avatar yonghong-song Committed by GitHub

Merge pull request #1413 from r4f4/fix-exception-py3

Fix exception handling in python3
parents fbbe6d6e 6be6e2c0
...@@ -527,7 +527,7 @@ class PerfEventArray(ArrayBase): ...@@ -527,7 +527,7 @@ class PerfEventArray(ArrayBase):
def raw_cb_(_, data, size): def raw_cb_(_, data, size):
try: try:
callback(cpu, data, size) callback(cpu, data, size)
except IOError, e: except IOError as e:
if e.errno == errno.EPIPE: if e.errno == errno.EPIPE:
exit() exit()
else: else:
...@@ -535,7 +535,7 @@ class PerfEventArray(ArrayBase): ...@@ -535,7 +535,7 @@ class PerfEventArray(ArrayBase):
def lost_cb_(lost): def lost_cb_(lost):
try: try:
lost_cb(lost) lost_cb(lost)
except IOError, e: except IOError as e:
if e.errno == errno.EPIPE: if e.errno == errno.EPIPE:
exit() exit()
else: else:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment