Ticket #47: scapy-gnuplot_with.patch

File scapy-gnuplot_with.patch, 1.6 kB (added by lobo@c3a.de, 5 months ago)

Patch for Gnuplot.Data Python2.6 reserved keyword warning

  • a/scapy.py

    old new  
    32213221            if loctrace: 
    32223222                trt[trace_id] = loctrace 
    32233223 
    3224         tr = map(lambda x: Gnuplot.Data(x,with="lines"), trt.values()) 
     3224        try: 
     3225            tr = map(lambda x: Gnuplot.Data(x,with_="lines"), trt.values()) 
     3226        except Gnuplot.Errors.OptionError: 
     3227            warning("This version of Python Gnuplot uses the keyword \"with\",\n" \ 
     3228                    "which will become a reserved keyword in Python 2.6!\n" \ 
     3229                    "Please upgrade to a Python Gnuplot Version >= 1.8\n") 
     3230            tr = map(lambda x: Gnuplot.Data(x,with="lines"), trt.values()) 
     3231 
    32253232        g = Gnuplot.Gnuplot() 
    3226         world = Gnuplot.File(conf.gnuplot_world,with="lines") 
     3233        try: 
     3234            world = Gnuplot.File(conf.gnuplot_world,with_="lines") 
     3235        except Gnuplot.Errors.OptionError: 
     3236            warning("This version of Python Gnuplot uses the keyword \"with\",\n" \ 
     3237                    "which will become a reserved keyword in Python 2.6!\n" \ 
     3238                    "Please upgrade to a Python Gnuplot Version >= 1.8.\n") 
     3239            world = Gnuplot.File(conf.gnuplot_world,with="lines") 
    32273240        g.plot(world,*tr) 
    32283241        return g 
    32293242