From 17aabe961defb0660bcef12c9026e8d8cae88093 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Wed, 29 Jan 2020 16:39:08 -0800 Subject: [PATCH] Take advantage of pathclass.Extension comparison functionality. --- fileprefix.py | 2 +- search.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fileprefix.py b/fileprefix.py index c8e5f4c..2493837 100644 --- a/fileprefix.py +++ b/fileprefix.py @@ -42,7 +42,7 @@ def fileprefix( filepaths = current_directory.listdir() filepaths = [f for f in filepaths if f.is_file] - filepaths = [f for f in filepaths if f.extension.lower() not in IGNORE_EXTENSIONS] + filepaths = [f for f in filepaths if f.extension not in IGNORE_EXTENSIONS] try: pyfile = pathclass.Path(__file__) diff --git a/search.py b/search.py index 8bcd7c7..1e53be6 100644 --- a/search.py +++ b/search.py @@ -192,7 +192,7 @@ def search( if not filepath.is_file: continue - if filepath.extension.lower() == 'lnk' and winshell: + if filepath.extension == 'lnk' and winshell: yield from search_contents_windows_lnk(filepath, content_args) else: yield from search_contents_generic(filepath, content_args)