Commit bc3df70b authored by Victor Stinner's avatar Victor Stinner Committed by GitHub

bpo-18174: Fix fd_count() on FreeBSD (GH-7420)

Python 2.7 doesn't have FileNotFoundError exception: use OSError and
errno.ENOENT.
parent 64856ad8
...@@ -2069,8 +2069,9 @@ def fd_count(): ...@@ -2069,8 +2069,9 @@ def fd_count():
try: try:
names = os.listdir("/proc/self/fd") names = os.listdir("/proc/self/fd")
return len(names) return len(names)
except FileNotFoundError: except OSError as exc:
pass if exc.errno != errno.ENOENT:
raise
old_modes = None old_modes = None
if sys.platform == 'win32': if sys.platform == 'win32':
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment