[Checkins] SVN: manuel/trunk/src/manuel/sphinx.py Don't monkey-patch if we aren't going to unmonkey-patch.

Lennart Regebro regebro at gmail.com
Sun Jan 3 16:23:35 EST 2010


Log message for revision 107602:
  Don't monkey-patch if we aren't going to unmonkey-patch.

Changed:
  U   manuel/trunk/src/manuel/sphinx.py

-=-
Modified: manuel/trunk/src/manuel/sphinx.py
===================================================================
--- manuel/trunk/src/manuel/sphinx.py	2010-01-03 20:12:34 UTC (rev 107601)
+++ manuel/trunk/src/manuel/sphinx.py	2010-01-03 21:23:34 UTC (rev 107602)
@@ -104,15 +104,15 @@
     return compile(code, name, 'exec', flags, dont_inherit)
 
 def evaluate(region, document, globs):
+    if not isinstance(region.parsed, TestCase):
+        return
+
     try:
         old_compile = doctest.compile
     except AttributeError:
         old_compile = compile
     doctest.compile = monkey_compile
 
-    if not isinstance(region.parsed, TestCase):
-        return
-
     result = manuel.doctest.DocTestResult()
     if region.parsed.group:
         test_name = region.parsed.group



More information about the checkins mailing list