cloudmatrix / esky

an auto-update framework for frozen python apps
BSD 3-Clause "New" or "Revised" License
362 stars 74 forks source link

Hard coded Python 3-style exec(....) statement in f_py2exe.py #99

Closed david-hughes closed 8 years ago

david-hughes commented 8 years ago

In github, esky/bdist_esky/f_py2exe.py line 379-380 says

  for code in codelist:
      exec(code, d_globals, d_locals)

but Python 2.x requires the syntax

  for code in codelist:
      exec code in d_globals, d_locals

I guess this requires conditional coding depending on the version of Python being used, as is done in f_cxfreeze.py

David Hughes Forestfield Software

timeyyy commented 8 years ago

Thanks for the feedback David, issue is now fixed on master branch

david-hughes commented 8 years ago

Re #99 I think the conditional test needs to be against _sys.versioninfo[0] not sys.version[0] but even with that it still isn't working (I thought it was originally). The block of 'code' containing this change is actually a long text string that gets loaded into "something" and gets executed. So I think the version2/version3 test needs to be outside this block - like it is in f_cxfreeze.py. I will have another look at it tomorrow.

david-hughes commented 8 years ago

The following change shamelessly borrowed from f_cxfreeze seems to be working OK

f_py2exe-diff