Skip to content

Commit

Permalink
Catch shutting down ImportError (#4267)
Browse files Browse the repository at this point in the history
  • Loading branch information
gpotter2 committed Feb 6, 2024
1 parent 703cd5a commit d3442b4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scapy/automaton.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,11 @@ def close(self):
os.close(self.__rd)
os.close(self.__wr)
if WINDOWS:
self._winclose()
try:
self._winclose()
except ImportError:
# Python is shutting down
pass

def __repr__(self):
# type: () -> str
Expand Down

0 comments on commit d3442b4

Please sign in to comment.