[pypy-svn] r15255 - in pypy/dist/pypy: annotation module/sys

cfbolz at codespeak.net cfbolz at codespeak.net
Thu Jul 28 16:33:34 CEST 2005


Author: cfbolz
Date: Thu Jul 28 16:33:32 2005
New Revision: 15255

Modified:
   pypy/dist/pypy/annotation/builtin.py
   pypy/dist/pypy/module/sys/__init__.py
   pypy/dist/pypy/module/sys/vm.py
Log:
removed getrefcount from our sys module since we couldn't find an obvious way to implement it (even with strange things in the backend).

Modified: pypy/dist/pypy/annotation/builtin.py
==============================================================================
--- pypy/dist/pypy/annotation/builtin.py	(original)
+++ pypy/dist/pypy/annotation/builtin.py	Thu Jul 28 16:33:32 2005
@@ -275,7 +275,6 @@
 # this one is needed otherwise when annotating assert in a test we may try to annotate 
 # py.test AssertionError.__init__ .
 BUILTIN_ANALYZERS[AssertionError.__init__.im_func] = exception_init
-BUILTIN_ANALYZERS[sys.getrefcount] = count
 BUILTIN_ANALYZERS[sys.getdefaultencoding] = conf
 import unicodedata
 BUILTIN_ANALYZERS[unicodedata.decimal] = unicodedata_decimal # xxx

Modified: pypy/dist/pypy/module/sys/__init__.py
==============================================================================
--- pypy/dist/pypy/module/sys/__init__.py	(original)
+++ pypy/dist/pypy/module/sys/__init__.py	Thu Jul 28 16:33:32 2005
@@ -35,7 +35,6 @@
         'builtin_module_names'  : 'state.get(space).w_builtin_module_names', 
         'pypy_getudir'          : 'state.pypy_getudir', 
 
-        'getrefcount'           : 'vm.getrefcount', 
         '_getframe'             : 'vm._getframe', 
         'setrecursionlimit'     : 'vm.setrecursionlimit', 
         'getrecursionlimit'     : 'vm.getrecursionlimit', 

Modified: pypy/dist/pypy/module/sys/vm.py
==============================================================================
--- pypy/dist/pypy/module/sys/vm.py	(original)
+++ pypy/dist/pypy/module/sys/vm.py	Thu Jul 28 16:33:32 2005
@@ -83,15 +83,15 @@
     from pypy.tool.udir import udir
     return space.wrap(str(udir))
 
-def getrefcount(space, w_obj):
-    """getrefcount(object) -> integer
-    Return the reference count of object.  The count returned is generally
-    one higher than you might expect, because it includes the (temporary)
-    reference as an argument to getrefcount().
-    """
-    # From the results i get when using this i need to apply a fudge
-    # value of 6 to get results comparable to cpythons. /Arre
-    return space.wrap(sys.getrefcount(w_obj) - 6)
+## def getrefcount(space, w_obj):
+##     """getrefcount(object) -> integer
+##     Return the reference count of object.  The count returned is generally
+##     one higher than you might expect, because it includes the (temporary)
+##     reference as an argument to getrefcount().
+##     """
+##     # From the results i get when using this i need to apply a fudge
+##     # value of 6 to get results comparable to cpythons. /Arre
+##     return space.wrap(sys.getrefcount(w_obj) - 6)
 
 def settrace(space, w_func):
     """settrace(function)



More information about the Pypy-commit mailing list