summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2013-02-15 18:02:06 +0100
committerhut <hut@lavabit.com>2013-02-15 18:10:15 +0100
commit325cac10f7c3af8e7c8fd22469f4354e72a2df90 (patch)
tree76b6524f39aad0ddc9f1e965fcd4968a2fcbbc95
parent0566a8eadffa09142cc31d7e0b4feacea99ff5c8 (diff)
downloadranger-325cac10f7c3af8e7c8fd22469f4354e72a2df90.tar.gz
fsobject.directory: removed useless code in accept_file
the code "if hidden_filter in fname" assumes that hidden_filter is a
string, which can never happen since Directory.load_bit_by_bit converts
the string value to a regexp
-rw-r--r--ranger/fsobject/directory.py9
1 files changed, 2 insertions, 7 deletions
diff --git a/ranger/fsobject/directory.py b/ranger/fsobject/directory.py
index 2aa47a64..d21c856d 100644
--- a/ranger/fsobject/directory.py
+++ b/ranger/fsobject/directory.py
@@ -37,13 +37,8 @@ def sort_naturally_icase(path):
     return path.basename_natural_lower
 
 def accept_file(fname, dirname, hidden_filter, name_filter):
-    if hidden_filter:
-        try:
-            if hidden_filter.search(fname):
-                return False
-        except:
-            if hidden_filter in fname:
-                return False
+    if hidden_filter and hidden_filter.search(fname):
+        return False
     if name_filter and name_filter not in fname:
         return False
     return True