Comments
Patch
@@ -17,16 +17,23 @@ import sys
# allow - allow pure Python implementation when C loading fails
# py - only load pure Python modules
modulepolicy = '@MODULELOADPOLICY@'
# By default, require the C extensions for performance reasons.
if modulepolicy == '@' 'MODULELOADPOLICY' '@':
modulepolicy = 'c'
+# PyPy doesn't load C extensions.
+#
+# The canonical way to do this is to test platform.python_implementation().
+# But we don't import platform and don't bloat for it here.
+if '__pypy__' in sys.builtin_module_names:
+ modulepolicy = 'py'
+
# Environment variable can always force settings.
modulepolicy = os.environ.get('HGMODULEPOLICY', modulepolicy)
# Modules that have both Python and C implementations. See also the
# set of .py files under mercurial/pure/.
_dualmodules = set([
'mercurial.base85',
'mercurial.bdiff',