Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax error when I import dpkt #17

Closed
GoogleCodeExporter opened this issue Mar 14, 2015 · 2 comments
Closed

Syntax error when I import dpkt #17

GoogleCodeExporter opened this issue Mar 14, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

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
Copy link
Author

Same trouble

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

@GoogleCodeExporter
Copy link
Author

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

  • Changed state: Duplicate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant