Issue 4005: Remove .sort() call on dict_keys object.
This caused pydoc to fail when there was a zip file in sys.path.
Patch contributed by Amaury Forgeot d'Arc.
diff --git a/Lib/test/test_pkgutil.py b/Lib/test/test_pkgutil.py
index 169ef66..f69af5a 100644
--- a/Lib/test/test_pkgutil.py
+++ b/Lib/test/test_pkgutil.py
@@ -74,6 +74,12 @@
self.assertEqual(res1, RESOURCE_DATA)
res2 = pkgutil.get_data(pkg, 'sub/res.txt')
self.assertEqual(res2, RESOURCE_DATA)
+
+ names = []
+ for loader, name, ispkg in pkgutil.iter_modules([zip_file]):
+ names.append(name)
+ self.assertEqual(names, ['test_getdata_zipfile'])
+
del sys.path[0]
del sys.modules[pkg]