[pypy-svn] r10311 - in pypy/dist/pypy: module/sys2 tool

sanxiyn at codespeak.net sanxiyn at codespeak.net
Tue Apr 5 07:01:16 CEST 2005


Author: sanxiyn
Date: Tue Apr  5 07:01:16 2005
New Revision: 10311

Modified:
   pypy/dist/pypy/module/sys2/state.py
   pypy/dist/pypy/tool/hack.py
   pypy/dist/pypy/tool/uid.py
Log:
Restored metacircularity. (PyPy on PyPy)
 * pypy.tool.hack: don't do func_with_new_name inside PyPy
 * pypy.tool.uid: skip struct.calcsize('P') for now
 * pypy.module.sys2.state: unicodedata is required in
   pypy.objspace.std.unicodeobject (for unicode_to_decimal)

See also my post to pypy-dev.


Modified: pypy/dist/pypy/module/sys2/state.py
==============================================================================
--- pypy/dist/pypy/module/sys2/state.py	(original)
+++ pypy/dist/pypy/module/sys2/state.py	Tue Apr  5 07:01:16 2005
@@ -27,7 +27,7 @@
 for fn in ['posix', 'nt', 'os2', 'mac', 'ce', 'riscos',
            'math', '_codecs', 'array', 'select',
            '_random', '_sre', 'time', '_socket', 'errno',
-           'binascii',
+           'binascii', 'unicodedata',
            #'parser'
            ]: 
     if fn not in builtin_modules:

Modified: pypy/dist/pypy/tool/hack.py
==============================================================================
--- pypy/dist/pypy/tool/hack.py	(original)
+++ pypy/dist/pypy/tool/hack.py	Tue Apr  5 07:01:16 2005
@@ -1,9 +1,8 @@
 import autopath
-
 import new, sys
 
-if sys.version_info >= (2, 3):
-
+if (sys.version_info >= (2, 3) and
+    not hasattr(sys, 'pypy_objspaceclass')):
     def func_with_new_name(func, newname):
         f = new.function(func.func_code, func.func_globals,
                             newname, func.func_defaults,
@@ -12,9 +11,7 @@
             f.func_dict = {}
             f.func_dict.update(func.func_dict) 
         return f 
-
 else:
-
     def func_with_new_name(func, newname):
         return func
 

Modified: pypy/dist/pypy/tool/uid.py
==============================================================================
--- pypy/dist/pypy/tool/uid.py	(original)
+++ pypy/dist/pypy/tool/uid.py	Tue Apr  5 07:01:16 2005
@@ -1,7 +1,10 @@
 import struct
 
-HUGEVAL = 256 ** struct.calcsize('P')
+# This is temporary hack to run PyPy on PyPy
+# until PyPy's struct module handle P format character.
 
+#HUGEVAL = 256 ** struct.calcsize('P')
+HUGEVAL = 0
 
 def fixid(result):
     if result < 0:



More information about the Pypy-commit mailing list