[Zope3-checkins] SVN: Zope3/branches/ZopeX3-3.0/src/RestrictedPython/tests/testRestrictions.py Fix obscure bug that caused the source not to be fonud when installed using

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


Log message for revision 27434:
  Fix obscure bug that caused the source not to be fonud when installed using
  via distutils to a relative path.
  


Changed:
  U   Zope3/branches/ZopeX3-3.0/src/RestrictedPython/tests/testRestrictions.py


-=-
Modified: Zope3/branches/ZopeX3-3.0/src/RestrictedPython/tests/testRestrictions.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/RestrictedPython/tests/testRestrictions.py	2004-09-02 22:49:58 UTC (rev 27433)
+++ Zope3/branches/ZopeX3-3.0/src/RestrictedPython/tests/testRestrictions.py	2004-09-03 02:13:22 UTC (rev 27434)
@@ -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 Zope3-Checkins mailing list