From 8620a70b45ad4e7222c19ba89b2232821cd4aa70 Mon Sep 17 00:00:00 2001 From: Doug Greiman Date: Fri, 22 Dec 2017 14:51:36 -0800 Subject: Slightly simplify code via rstrip() --- pkg_resources/__init__.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg_resources/__init__.py b/pkg_resources/__init__.py index ffaf7aca..08f9bbe7 100644 --- a/pkg_resources/__init__.py +++ b/pkg_resources/__init__.py @@ -1693,8 +1693,7 @@ class ZipProvider(EggProvider): def _zipinfo_name(self, fspath): # Convert a virtual filename (full path to file) into a zipfile subpath # usable with the zipimport directory cache for our target archive - while fspath.endswith(os.sep): - fspath = fspath[:-1] + fspath = fspath.rstrip(os.sep) if fspath == self.loader.archive: return '' if fspath.startswith(self.zip_pre): -- cgit v1.2.3