You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I got a problem after I generate exe with pyinstaller. It shows that dpkt
use some hacking way to import module. After I view the source code of
dpkt. I found that:
# XXX - auto-load Ethernet dispatch table from ETH_TYPE_* definitions
def __load_types():
import os
d = dict.fromkeys([ x[:-3] for x in
os.listdir(os.path.dirname(__file__) or '.') if x.endswith('.py') ])
g = globals()
for k, v in g.iteritems():
if k.startswith('ETH_TYPE_'):
name = k[9:]
modname = name.lower()
if modname in d:
mod = __import__(modname, g)
Ethernet.set_type(v, getattr(mod, name))
This hacking code load modules dynamically, so once it is packaged as exe
or something else, that function visit a wrong path like this
"\\buildcards\\out1.pyz/*.*"
Could you fix the problem by not to use strange hacking way to load
modules? Or provide some way to customize that behavior.
Thanks.
Original issue reported on code.google.com by Borns...@gmail.com on 30 May 2009 at 10:17
An alternative solution:
http://www.py2exe.org/index.cgi/ConfigImportProblems
Otherwise, we need to build static mappings for Ethernet types, IP protocols,
etc.
without circular imports.
Original comment by dugsong on 26 Mar 2010 at 2:44
Original issue reported on code.google.com by
Borns...@gmail.com
on 30 May 2009 at 10:17The text was updated successfully, but these errors were encountered: