http://code.google.com/p/web2py/issues/detail?id=464, thanks alwassoc
This commit is contained in:
@@ -1 +1 @@
|
||||
Version 1.99.3 (2011-12-03 00:25:21) dev
|
||||
Version 1.99.3 (2011-12-03 00:35:14) dev
|
||||
|
||||
@@ -40,12 +40,15 @@ import imp
|
||||
import logging
|
||||
logger = logging.getLogger("web2py")
|
||||
import rewrite
|
||||
import platform
|
||||
|
||||
try:
|
||||
import py_compile
|
||||
except:
|
||||
logger.warning('unable to import py_compile')
|
||||
|
||||
is_pypy = True if platform.python_implementation() == 'PyPy' else False
|
||||
settings.global_settings.is_pypy = is_pypy
|
||||
is_gae = settings.global_settings.web2py_runtime_gae
|
||||
is_jython = settings.global_settings.is_jython = 'java' in sys.platform.lower() or hasattr(sys, 'JYTHON_JAR') or str(sys.copyright).find('Jython') > 0
|
||||
|
||||
@@ -344,6 +347,8 @@ def build_environment(request, response, session, store_current=True):
|
||||
global __builtins__
|
||||
if is_jython: # jython hack
|
||||
__builtins__ = mybuiltin()
|
||||
elif is_pypy: # apply the same hack to pypy too
|
||||
__builtins__ = mybuiltin()
|
||||
else:
|
||||
__builtins__['__import__'] = __builtin__.__import__ ### WHY?
|
||||
environment['__builtins__'] = __builtins__
|
||||
|
||||
Reference in New Issue
Block a user