From c854bf55b16b70fbcf8ed2ba76660b62d49c662c Mon Sep 17 00:00:00 2001 From: 4shen0ne <4shen.01@gmail.com> Date: Wed, 23 Oct 2024 17:29:53 +0800 Subject: [PATCH 1/2] bug fix --- dirsearch.py | 2 +- lib/utils/diff.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dirsearch.py b/dirsearch.py index 83233625d..dcd539b69 100755 --- a/dirsearch.py +++ b/dirsearch.py @@ -28,7 +28,7 @@ from lib.parse.config import ConfigParser if sys.version_info < (3, 9): - sys.stderr.write("Sorry, dirsearch requires Python 3.8 or higher\n") + sys.stderr.write("Sorry, dirsearch requires Python 3.9 or higher\n") sys.exit(1) # silence pkg_resources deprecation warnings diff --git a/lib/utils/diff.py b/lib/utils/diff.py index d0249df73..2a4248fb2 100755 --- a/lib/utils/diff.py +++ b/lib/utils/diff.py @@ -53,7 +53,7 @@ def compare_to(self, content): for pattern in self._static_patterns: try: i = splitted_content.index(pattern, i + 1) - except IndexError: + except (IndexError, ValueError): return False # The number of static patterns is not big enough to say it's a reliable method From 97e6057c6d0c87d9a258a1d1fd76e395db30984f Mon Sep 17 00:00:00 2001 From: Pham Sy Minh <59408894+shelld3v@users.noreply.github.com> Date: Wed, 23 Oct 2024 17:40:47 +0700 Subject: [PATCH 2/2] Better fix --- lib/utils/diff.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/utils/diff.py b/lib/utils/diff.py index 2a4248fb2..76ab71ba8 100755 --- a/lib/utils/diff.py +++ b/lib/utils/diff.py @@ -53,7 +53,7 @@ def compare_to(self, content): for pattern in self._static_patterns: try: i = splitted_content.index(pattern, i + 1) - except (IndexError, ValueError): + except ValueError: return False # The number of static patterns is not big enough to say it's a reliable method