[pypy-svn] commit/pypy: 2 new changesets

Bitbucket commits-noreply at bitbucket.org
Thu Dec 16 10:01:58 CET 2010


2 new changesets in pypy:

http://bitbucket.org/pypy/pypy/changeset/0fb8508b7a63/
changeset:   r40052:0fb8508b7a63
user:        arigo
date:        2010-12-16 09:59:22
summary:     Decided to silence the warning printed by sys.setrecursionlimit().
Instead, give it a better docstring.
affected #:  1 file (312 bytes)

--- a/pypy/module/sys/vm.py	Wed Dec 15 22:04:59 2010 -0600
+++ b/pypy/module/sys/vm.py	Thu Dec 16 09:59:22 2010 +0100
@@ -42,19 +42,24 @@
     return space.wrap(f)
 
 def setrecursionlimit(space, w_new_limit):
-    """DEPRECATED on PyPy. Will issue warning and not work
-    """
+    """setrecursionlimit() is ignored (and not needed) on PyPy.
+
+On CPython it would set the maximum number of nested calls that can
+occur before a RuntimeError is raised.  On PyPy overflowing the stack
+also causes RuntimeErrors, but the limit is checked at a lower level.
+(The limit is currenty hard-coded at 768 KB, corresponding to roughly
+1480 Python calls on Linux.)"""
     new_limit = space.int_w(w_new_limit)
     if new_limit <= 0:
         raise OperationError(space.w_ValueError,
                              space.wrap("recursion limit must be positive"))
-    # global recursion_limit
-    # we need to do it without writing globals.
-    space.warn('setrecursionlimit() is ignored (and not needed) on PyPy', space.w_DeprecationWarning)
+    # for now, don't rewrite a warning but silently ignore the
+    # recursion limit.
+    #space.warn('setrecursionlimit() is ignored (and not needed) on PyPy', space.w_RuntimeWarning)
     space.sys.recursionlimit = new_limit
 
 def getrecursionlimit(space):
-    """DEPRECATED on PyPy. Will issue warning and not work
+    """Return the last value set by setrecursionlimit().
     """
     return space.wrap(space.sys.recursionlimit)
 


http://bitbucket.org/pypy/pypy/changeset/c55286db0781/
changeset:   r40053:c55286db0781
user:        arigo
date:        2010-12-16 10:01:46
summary:     Document this publicly.
affected #:  1 file (418 bytes)

--- a/pypy/doc/cpython_differences.txt	Thu Dec 16 09:59:22 2010 +0100
+++ b/pypy/doc/cpython_differences.txt	Thu Dec 16 10:01:46 2010 +0100
@@ -204,4 +204,16 @@
 lets the exception propagate instead.
 
 
+Miscellaneous
+-------------
+
+* ``sys.setrecursionlimit()`` is ignored (and not needed) on
+  PyPy.  On CPython it would set the maximum number of nested
+  calls that can occur before a RuntimeError is raised; on PyPy
+  overflowing the stack also causes RuntimeErrors, but the limit
+  is checked at a lower level.  (The limit is currenty hard-coded
+  at 768 KB, corresponding to roughly 1480 Python calls on
+  Linux.)
+
+
 .. include:: _ref.txt

Repository URL: https://bitbucket.org/pypy/pypy/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.



More information about the Pypy-commit mailing list