summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_tcl.py
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2010-06-04 19:50:26 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2010-06-04 19:50:26 (GMT)
commit2d5157eb913bdf0eeefd0016ab6a621dd1727525 (patch)
tree01782abb589a3e8e05443ecd7319713bac482cd4 /Lib/test/test_tcl.py
parentb6b8110c48dd5111cf57ec83a485c517084aca41 (diff)
downloadcpython-2d5157eb913bdf0eeefd0016ab6a621dd1727525.zip
cpython-2d5157eb913bdf0eeefd0016ab6a621dd1727525.tar.gz
cpython-2d5157eb913bdf0eeefd0016ab6a621dd1727525.tar.bz2
Merged revisions 81701 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r81701 | martin.v.loewis | 2010-06-04 21:39:07 +0200 (Fr, 04 Jun 2010) | 2 lines Issue #6470: Drop UNC prefix in FixTk.py Patch by Christop Gohlke and Amaury Forgeot d'Arc. ........
Diffstat (limited to 'Lib/test/test_tcl.py')
-rw-r--r--Lib/test/test_tcl.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/Lib/test/test_tcl.py b/Lib/test/test_tcl.py
index 0df1fea..5bd781d 100644
--- a/Lib/test/test_tcl.py
+++ b/Lib/test/test_tcl.py
@@ -127,6 +127,31 @@ class TclTest(unittest.TestCase):
tcl = self.interp
self.assertRaises(TclError,tcl.eval,'package require DNE')
+ def testLoadWithUNC(self):
+ import sys
+ if sys.platform != 'win32':
+ return
+
+ # Build a UNC path from the regular path.
+ # Something like
+ # \\%COMPUTERNAME%\c$\python27\python.exe
+
+ fullname = os.path.abspath(sys.executable)
+ if fullname[1] != ':':
+ return
+ unc_name = r'\\%s\%s$\%s' % (os.environ['COMPUTERNAME'],
+ fullname[0],
+ fullname[3:])
+
+ with test_support.EnvironmentVarGuard() as env:
+ env.unset("TCL_LIBRARY")
+ f = os.popen('%s -c "import Tkinter; print Tkinter"' % (unc_name,))
+
+ self.assert_('Tkinter.py' in f.read())
+ # exit code must be zero
+ self.assertEqual(f.close(), None)
+
+
def test_main():
support.run_unittest(TclTest, TkinterTest)