Thanks,

I actually did venture into the code a bit. So it looks like cxFreeze is, like 
you said, inspecting  what's imported dynamically and only copies those 
implicitly used. In asyncio's case, a lot of submodules are imported but things 
like compat was left out probably because it was imported relatively.


There doesn't seem to be an obvious fix for this unfortunately. Any suggestion?


Simon

________________________________
From: Thomas Kluyver <tak...@gmail.com>
Sent: Tuesday, February 14, 2017 7:11:44 PM
To: primary discussion list for use and development of cx_Freeze
Subject: Re: [cx-freeze-users] Missing relative import from asyncio

On 14 February 2017 at 07:51, Simon Leung 
<theothersi...@outlook.com<mailto:theothersi...@outlook.com>> wrote:

These packages are included relatively like this:

   from . import bla

Perhaps cxfreeze isn't handling this well?

cx_Freeze detects imports by reading the compiled Python bytecode. This 
mechanism is fairly fragile, as bytecode can change from one Python release to 
the next, and I've encountered silent failures with it before. I think it might 
be more reliable to detect imports based on the AST - although that can also 
change with each Python version, I suspect it's easier to reason about and 
detect when it's going wrong.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
cx-freeze-users mailing list
cx-freeze-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cx-freeze-users

Reply via email to