|
From: <pj...@us...> - 2009-10-20 03:28:41
|
Revision: 6882
http://jython.svn.sourceforge.net/jython/?rev=6882&view=rev
Author: pjenvey
Date: 2009-10-20 03:28:30 +0000 (Tue, 20 Oct 2009)
Log Message:
-----------
only import these when necessary
Modified Paths:
--------------
trunk/jython/Lib/ntpath.py
trunk/jython/Lib/posixpath.py
Modified: trunk/jython/Lib/ntpath.py
===================================================================
--- trunk/jython/Lib/ntpath.py 2009-10-20 01:20:43 UTC (rev 6881)
+++ trunk/jython/Lib/ntpath.py 2009-10-20 03:28:30 UTC (rev 6882)
@@ -5,11 +5,9 @@
module as os.path.
"""
-import java.io.File
import os
import stat
import sys
-from org.python.core.Py import newString
__all__ = ["normcase","isabs","join","splitdrive","split","splitext",
"basename","dirname","commonprefix","getsize","getmtime",
@@ -487,6 +485,9 @@
from nt import _getfullpathname
except ImportError: # not running on Windows - mock up something sensible
+ import java.io.File
+ from org.python.core.Py import newString
+
def abspath(path):
"""Return the absolute version of a path."""
if not isabs(path):
Modified: trunk/jython/Lib/posixpath.py
===================================================================
--- trunk/jython/Lib/posixpath.py 2009-10-20 01:20:43 UTC (rev 6881)
+++ trunk/jython/Lib/posixpath.py 2009-10-20 03:28:30 UTC (rev 6882)
@@ -10,11 +10,8 @@
for manipulation of the pathname component of URLs.
"""
-import java.io.File
-import java.io.IOException
import os
import stat
-from org.python.core.Py import newString
__all__ = ["normcase","isabs","join","splitdrive","split","splitext",
"basename","dirname","commonprefix","getsize","getmtime",
@@ -217,6 +214,10 @@
# Are two filenames really pointing to the same file?
if not os._native_posix:
+ import java.io.File
+ import java.io.IOException
+ from org.python.core.Py import newString
+
def samefile(f1, f2):
"""Test whether two pathnames reference the same actual file"""
canon1 = newString(java.io.File(_ensure_str(f1)).getCanonicalPath())
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|