SF.net SVN: jython:[7244] trunk/jython/src/org/python/core/ThreadState.java

[email protected] Fri, 18 Mar 2011 01:26:56 +0000
Newsgroups gmane.comp.lang.jython.cvs
Message-ID <[email protected]>
Revision: 7244
          http://jython.svn.sourceforge.net/jython/?rev=7244&view=rev
Author:   pjenvey
Date:     2011-03-18 01:26:55 +0000 (Fri, 18 Mar 2011)

Log Message:
-----------
add ThreadState.enter/leaveRecursiveCall

Modified Paths:
--------------
    trunk/jython/src/org/python/core/ThreadState.java

Modified: trunk/jython/src/org/python/core/ThreadState.java
===================================================================
--- trunk/jython/src/org/python/core/ThreadState.java	2011-03-17 23:02:35 UTC (rev 7243)
+++ trunk/jython/src/org/python/core/ThreadState.java	2011-03-18 01:26:55 UTC (rev 7244)
@@ -86,4 +86,14 @@
         }
         return compareStateDict;
     }
+
+    public void enterRecursiveCall(String where) {
+        if (recursion_depth++ > systemState.getrecursionlimit()) {
+            throw Py.RuntimeError("maximum recursion depth exceeded" + where);
+        }
+    }
+
+    public void leaveRecursiveCall() {
+        --recursion_depth;
+    }
 }


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d