From 4b63697f9d125fa7187dd53a1d15fd0cd7cef6ff Mon Sep 17 00:00:00 2001 From: Ovank Date: Sun, 19 May 2024 00:54:20 +0530 Subject: [PATCH] Update ext.py Fixes issue #45 Code is not equipped to handle scenario when ```shutil.which``` return *None*. Adding ```TypeError``` Exception to the error handling. --- sphinxarg/ext.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sphinxarg/ext.py b/sphinxarg/ext.py index 559a6067..cb11b7d4 100644 --- a/sphinxarg/ext.py +++ b/sphinxarg/ext.py @@ -445,7 +445,7 @@ def _open_filename(self): # try open with shutil which try: return open(shutil.which(self.options['filename'])) - except OSError: + except (OSError, TypeError): pass # raise exception raise FileNotFoundError(self.options['filename'])