Patchwork D3958: Allow to run setup.py with python 3 without a mercurial checkout

login
register
mail settings
Submitter phabricator
Date July 17, 2018, 12:48 a.m.
Message ID <373a2adcaa444d390192349bb0fc709f@localhost.localdomain>
Download mbox | patch
Permalink /patch/32893/
State Not Applicable
Headers show

Comments

phabricator - July 17, 2018, 12:48 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGd5b31ae9cc0a: Allow to run setup.py with python 3 without a mercurial checkout (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3958?vs=9614&id=9615

REVISION DETAIL
  https://phab.mercurial-scm.org/D3958

AFFECTED FILES
  setup.py

CHANGE DETAILS




To: glandium, indygreg, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -74,7 +74,7 @@ 
     badpython = True
 
     # Allow Python 3 from source checkouts.
-    if os.path.isdir('.hg'):
+    if os.path.isdir('.hg') or 'HGPYTHON3' in os.environ:
         badpython = False
 
     if badpython:
@@ -369,7 +369,7 @@ 
     from mercurial import __version__
     version = __version__.version
 except ImportError:
-    version = 'unknown'
+    version = b'unknown'
 finally:
     if oldpolicy is None:
         del os.environ['HGMODULEPOLICY']