[py-svn] r6946 - py/dist/py/path/fspy

hpk at codespeak.net hpk at codespeak.net
Fri Oct 15 02:56:22 CEST 2004


Author: hpk
Date: Fri Oct 15 02:56:21 2004
New Revision: 6946

Modified:
   py/dist/py/path/fspy/fspy.py
Log:
removed obsolete code 


Modified: py/dist/py/path/fspy/fspy.py
==============================================================================
--- py/dist/py/path/fspy/fspy.py	(original)
+++ py/dist/py/path/fspy/fspy.py	Fri Oct 15 02:56:21 2004
@@ -179,32 +179,6 @@
             source, lineno = inspect.findsource(obj) 
             return x.getfile(), lineno 
 
-    def getfile(self, scrapinit=0):
-        # XXX use imp.find_module to find a fspath without resolving the
-        try:
-            return self._filepath
-        except AttributeError:
-            pass
-        if self.modpath == '__main__': 
-            return path.local(sys.argv[0]) 
-        obj = self.resolve()
-        if obj is rootns:
-            return None
-            #raise ValueError, "Root Namespace has no file" 
-        if hasattr(obj, '__file__'):
-            p = path.local(obj.__file__) 
-        else:
-            try:
-                fn = inspect.getfile(obj)
-            except TypeError:
-                return None
-                # XXX? 
-                #raise ValueError("could not find file for %r" % self) 
-            p = path.local(fn) 
-        if scrapinit and p.get('purebasename') == '__init__':
-            p = p.dirpath()
-        return p
-
     def visit(self, fil=None, rec=None, seen=None):
         # XXX  gigantic hack for convenience of utest-collectors 
         if seen is None:



More information about the pytest-commit mailing list