[Zope-Checkins] SVN: Zope/trunk/lib/python/RestrictedPython/tests/testRestrictions.py Fix obscure bug that caused the source not to be found when installed using

Fred L. Drake, Jr. fdrake at gmail.com
Thu Sep 2 22:20:57 EDT 2004


Log message for revision 27436:
  Fix obscure bug that caused the source not to be found when installed using
  via distutils to a relative path.
  
  (corresponds with ZopeX3-3.0 branch revision 27434)
  


Changed:
  U   Zope/trunk/lib/python/RestrictedPython/tests/testRestrictions.py


-=-
Modified: Zope/trunk/lib/python/RestrictedPython/tests/testRestrictions.py
===================================================================
--- Zope/trunk/lib/python/RestrictedPython/tests/testRestrictions.py	2004-09-03 02:16:28 UTC (rev 27435)
+++ Zope/trunk/lib/python/RestrictedPython/tests/testRestrictions.py	2004-09-03 02:20:57 UTC (rev 27436)
@@ -52,8 +52,7 @@
 
 def get_source(func):
     """Less silly interface to find_source""" # Sheesh
-    code = func.func_code
-    return find_source(code.co_filename, code)[1]
+    return find_source(func.func_globals['__file__'], func.func_code)[1]
 
 def create_rmodule():
     global rmodule



More information about the Zope-Checkins mailing list