summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2021-11-09 09:02:32 -0500
committerJason R. Coombs <jaraco@jaraco.com>2021-11-09 09:04:29 -0500
commiteaa886bc1990cc3c17f8f10ce7f101a8d4e1ad06 (patch)
tree8450aed3bd3e6e35b98fd5389137c5891b48a0e0
parentf4c03484da59049eb62a9bf7777b963e2267d187 (diff)
downloadcpython-git-bpo-45765/metadata-distribution-empty-path.tar.gz
[bpo-45765] Fix distribution discovery on empty path.bpo-45765/metadata-distribution-empty-path
-rw-r--r--Lib/importlib/metadata/__init__.py2
-rw-r--r--Misc/NEWS.d/next/Library/2021-11-09-09-04-19.bpo-45765.JVobxK.rst1
2 files changed, 2 insertions, 1 deletions
diff --git a/Lib/importlib/metadata/__init__.py b/Lib/importlib/metadata/__init__.py
index f5172eefc1..b3e8fb05f1 100644
--- a/Lib/importlib/metadata/__init__.py
+++ b/Lib/importlib/metadata/__init__.py
@@ -748,7 +748,7 @@ class FastPath:
def children(self):
with suppress(Exception):
- return os.listdir(self.root or '')
+ return os.listdir(self.root or '.')
with suppress(Exception):
return self.zip_children()
return []
diff --git a/Misc/NEWS.d/next/Library/2021-11-09-09-04-19.bpo-45765.JVobxK.rst b/Misc/NEWS.d/next/Library/2021-11-09-09-04-19.bpo-45765.JVobxK.rst
new file mode 100644
index 0000000000..a1f4a1f7aa
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2021-11-09-09-04-19.bpo-45765.JVobxK.rst
@@ -0,0 +1 @@
+In importlib.metadata, fix distribution discovery for an empty path.