Skip to content

Commit

Permalink
Fixed command line argument handling when using IPython
Browse files Browse the repository at this point in the history
With IPython support enabled, any command line arguments
given to Scapy were incorrectly interpreted by the embedded
IPython shell as IPython command line arguments.
For example, "scapy -d" (to increase Scapy's debug level) did not work.
  • Loading branch information
dloss committed Jan 12, 2010
1 parent af80bbf commit 540caf9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scapy/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,8 @@ def attr_matches(self, text):

if IPYTHON:
banner = the_banner % (conf.version) + " using IPython %s" % IPython.__version__
ipshell = IPython.Shell.IPShellEmbed(banner = banner)
args = [''] # IPython command line args (will be seen as sys.argv)
ipshell = IPython.Shell.IPShellEmbed(args, banner = banner)
ipshell(local_ns=session)
else:
code.interact(banner = the_banner % (conf.version),
Expand Down

0 comments on commit 540caf9

Please sign in to comment.