Skip to content

Commit

Permalink
Merge pull request #2588 from guedou/session_error
Browse files Browse the repository at this point in the history
Warn if a Python3 session cannot be opened on Python2
  • Loading branch information
p-l- authored Apr 12, 2020
2 parents 421eafc + aed34f4 commit 85e0a50
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scapy/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,9 @@ def init_session(session_name, # type: Optional[Union[str, None]]
except IOError:
SESSION = six.moves.cPickle.load(open(session_name, "rb"))
log_loading.info("Using session [%s]" % session_name)
except ValueError:
msg = "Error opening Python3 pickled session on Python2 [%s]"
log_loading.error(msg % session_name)
except EOFError:
log_loading.error("Error opening session [%s]" % session_name)
except AttributeError:
Expand Down

0 comments on commit 85e0a50

Please # to comment.