diff options
Diffstat (limited to 'Lib/test/test_tcl.py')
-rw-r--r-- | Lib/test/test_tcl.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Lib/test/test_tcl.py b/Lib/test/test_tcl.py index fa170ef58d..6a87ce203f 100644 --- a/Lib/test/test_tcl.py +++ b/Lib/test/test_tcl.py @@ -150,6 +150,31 @@ class TclTest(unittest.TestCase): if old_display is not None: os.environ['DISPLAY'] = old_display + 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(): test_support.run_unittest(TclTest) |