Skip to content

Commit d3442b4

Browse files
authored
Catch shutting down ImportError (#4267)
1 parent 703cd5a commit d3442b4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

scapy/automaton.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,11 @@ def close(self):
226226
os.close(self.__rd)
227227
os.close(self.__wr)
228228
if WINDOWS:
229-
self._winclose()
229+
try:
230+
self._winclose()
231+
except ImportError:
232+
# Python is shutting down
233+
pass
230234

231235
def __repr__(self):
232236
# type: () -> str

0 commit comments

Comments
 (0)