Mercurial > hg
comparison setup.py @ 49073:97f2554cb647
setup: fix the py2exe logic to work with py3
TortoiseHg still uses (the modernized) py2exe packaging, but the build was
failing since `py2exe.Distribution` was removed.
One thing to note is that later in this module, there's a hack to include
`distutils` when building from a virtualenv. While `import distutils` works in
`hg debugshell` when built with py2, it doesn't work in py3. I'm not sure why-
I don't see it in `library.zip` either. It doesn't seem to break anything
though.
Differential Revision: https://phab.mercurial-scm.org/D12553
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Wed, 13 Apr 2022 14:25:13 -0400 |
parents | b6f535f3beda |
children | 050dc8730858 |
comparison
equal
deleted
inserted
replaced
49072:3cd57e2be49b | 49073:97f2554cb647 |
---|---|
195 | 195 |
196 # py2exe needs to be installed to work | 196 # py2exe needs to be installed to work |
197 try: | 197 try: |
198 import py2exe | 198 import py2exe |
199 | 199 |
200 py2exe.Distribution # silence unused import warning | 200 py2exe.patch_distutils() |
201 py2exeloaded = True | 201 py2exeloaded = True |
202 # import py2exe's patched Distribution class | 202 # import py2exe's patched Distribution class |
203 from distutils.core import Distribution | 203 from distutils.core import Distribution |
204 except ImportError: | 204 except ImportError: |
205 py2exeloaded = False | 205 py2exeloaded = False |