Skip to content

Commit 4a66eab

Browse files
authored
Update ext.py (#52)
Fixes issue #45 Code is not equipped to handle scenario when ```shutil.which``` return *None*. Adding ```TypeError``` Exception to the error handling.
1 parent c2f2766 commit 4a66eab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sphinxarg/ext.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ def _open_filename(self):
445445
# try open with shutil which
446446
try:
447447
return open(shutil.which(self.options['filename']))
448-
except OSError:
448+
except (OSError, TypeError):
449449
pass
450450
# raise exception
451451
raise FileNotFoundError(self.options['filename'])

0 commit comments

Comments
 (0)