Skip to content

Commit 7d4d601

Browse files
Use os.path.abspath instead
1 parent 531e7c3 commit 7d4d601

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/test/test_pkgutil.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def test_getdata_path_traversal(self):
7676
with self.assertRaises(ValueError):
7777
pkgutil.get_data(pkg, 'sub/../../../etc/passwd')
7878
with self.assertRaises(ValueError):
79-
pkgutil.get_data(pkg, os.sep + 'etc' + os.sep + 'passwd')
79+
pkgutil.get_data(pkg, os.path.abspath('/etc/passwd'))
8080

8181
del sys.modules[pkg]
8282

0 commit comments

Comments
 (0)