strange error when importing a module

Robin Becker robin at reportlab.com
Thu Jul 20 12:38:54 EDT 2006


Robin Becker wrote:
> I'm trying to understand the following strangeness
> 
> C:\code\rlextra\ers>python
> Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)] on win32
> Type "help", "copyright", "credits" or "license" for more information.
>  >>> from rlextra.utils.SimpleXMLRPCServer import SimpleXMLRPCServer
> Traceback (most recent call last):
>    File "<stdin>", line 1, in ?
>    File "c:\code\rlextra\utils\SimpleXMLRPCServer.py", line 148, in ?
>      import pydoc
>    File "C:\Python\lib\pydoc.py", line 54, in ?
>      import sys, imp, os, re, types, inspect, __builtin__
>    File "C:\Python\lib\inspect.py", line 31, in ?
>      import sys, os, types, string, re, dis, imp, tokenize, linecache
>    File "C:\Python\lib\tokenize.py", line 38, in ?
>      COMMENT = N_TOKENS
> NameError: name 'N_TOKENS' is not defined
> 
> SimpleXMLRPCServer.py is a legacy version of the current SimpleXMLRPCserver 
> code. I don't think there's anything special about it and as a standalone script 
> it appears to work fine (ie it seems to compile and run).
> 
> Any ideas?
grrrh I think we have a relative module import of token somewhere

-- 
Robin Becker




More information about the Python-list mailing list