Fix test_urllib2 error on Windows in relation with issue #13287.
This commit is contained in:
parent
245a94b6e8
commit
3dbb1f17cb
|
@ -26,6 +26,10 @@ class TrivialTests(unittest.TestCase):
|
|||
context = {}
|
||||
exec('from urllib.%s import *' % module, context)
|
||||
del context['__builtins__']
|
||||
if module == 'request' and os.name == 'nt':
|
||||
u, p = context.pop('url2pathname'), context.pop('pathname2url')
|
||||
self.assertEqual(u.__module__, 'nturl2path')
|
||||
self.assertEqual(p.__module__, 'nturl2path')
|
||||
for k, v in context.items():
|
||||
self.assertEqual(v.__module__, 'urllib.%s' % module,
|
||||
"%r is exposed in 'urllib.%s' but defined in %r" %
|
||||
|
|
Loading…
Reference in New Issue