Skip to content

Commit 8f475a8

Browse files
authored
Merge pull request #1291 from karpierz/PY3_compatibility_improvement_1
PY3 compatibility simplification and little improvement. [Please add to TODO]
2 parents c0d07a4 + 88de4f3 commit 8f475a8

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

scapy/automaton.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,6 @@
2323
from scapy.compat import *
2424
import scapy.modules.six as six
2525

26-
try:
27-
import thread
28-
except ImportError:
29-
THREAD_EXCEPTION = RuntimeError
30-
else:
31-
THREAD_EXCEPTION = thread.error
32-
3326
if WINDOWS:
3427
from scapy.error import Scapy_Exception
3528
recv_error = Scapy_Exception
@@ -107,7 +100,7 @@ def call_release(self, arborted=False):
107100
self.was_ended = arborted
108101
try:
109102
self.trigger.release()
110-
except (THREAD_EXCEPTION, AttributeError):
103+
except (threading.ThreadError, AttributeError):
111104
pass
112105

113106
class SelectableSelector(object):

0 commit comments

Comments
 (0)