scap1784 / dpkt

Automatically exported from code.google.com/p/dpkt
Other
0 stars 0 forks source link

Syntax error when I import dpkt #17

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Import dpkt.

Python 2.6.1 (r261:67517, Dec  4 2008, 16:51:00) [MSC v.1500 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import dpkt
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python26\Lib\site-packages\dpkt\__init__.py", line 17, in <module>
    import bgp
  File "C:\Python26\lib\site-packages\dpkt\bgp.py", line 678
    self.failUnless(c.as == 65215)
                       ^
SyntaxError: invalid syntax

Once I fixed that, I got this:

>>> import dpkt
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python26\Lib\site-packages\dpkt\__init__.py", line 17, in <module>
    import bgp
  File "C:\Python26\lib\site-packages\dpkt\bgp.py", line 715
    self.failUnless(b4.open.as == 237)
                             ^

So I fixed that, too. I think the problem is that "as" is a keyword in
Python >= 2.6.

dpkt 1.6 (from Windows EXE installer), on Windows 7 beta, on Python 2.6.1.

Original issue reported on code.google.com by snackypants on 26 Mar 2009 at 6:49

GoogleCodeExporter commented 9 years ago
Same trouble

Original comment by kosov.p...@gmail.com on 4 Jul 2009 at 12:21

GoogleCodeExporter commented 9 years ago
this was fixed in r51 and r52 of the subversion repository here.  please use 
that
updated code.

Original comment by yard...@gmail.com on 4 Jul 2009 at 2:57