[PATCH stable] demandimport: add __main__ to the blacklist (because of setuptools)

Greg Ward greg-hg at gerg.ca
Wed Jan 20 19:24:03 CST 2010


# HG changeset patch
# User Greg Ward <greg-hg at gerg.ca>
# Date 1264037016 18000
# Branch stable
# Node ID 992d832eecd81bcb22bcd889c01cbbb5431c2c68
# Parent  acf001ee5ef80c698b75d437d9685ed926a3e2fc
demandimport: add __main__ to the blacklist (because of setuptools)

diff --git a/mercurial/demandimport.py b/mercurial/demandimport.py
--- a/mercurial/demandimport.py
+++ b/mercurial/demandimport.py
@@ -130,6 +130,9 @@
     'resource',
     # this trips up many extension authors
     'gtk',
+    # setuptools' pkg_resources.py expects "from __main__ import x" to
+    # raise ImportError if x not defined
+    '__main__',
     ]
 
 def enable():


More information about the Mercurial-devel mailing list