Skip to content

Commit 6eba224

Browse files
committed
Remove unused code from which util
1 parent 3f238b4 commit 6eba224

File tree

1 file changed

+0
-33
lines changed

1 file changed

+0
-33
lines changed

libtmux/common.py

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import re
1212
import subprocess
1313
from distutils.version import StrictVersion
14-
from functools import wraps
1514

1615
from . import exc
1716
from ._compat import console_to_str
@@ -329,21 +328,6 @@ def get_by_id(self, id):
329328
return None
330329

331330

332-
def real_memoize(func):
333-
'''
334-
Memoize aka cache the return output of a function
335-
given a specific set of arguments
336-
'''
337-
cache = {}
338-
339-
@wraps(func)
340-
def _memoize(*args):
341-
if args not in cache:
342-
cache[args] = func(*args)
343-
return cache[args]
344-
return _memoize
345-
346-
347331
def which(exe=None):
348332
"""Return path of bin. Python clone of /usr/bin/which.
349333
@@ -363,23 +347,6 @@ def _is_executable_file_or_link(exe):
363347
# executable in cwd or fullpath
364348
return exe
365349

366-
ext_list = os.environ.get('PATHEXT', '.EXE').split(';')
367-
368-
@real_memoize
369-
def _exe_has_ext():
370-
'''
371-
Do a case insensitive test if exe has a file extension match in
372-
PATHEXT
373-
'''
374-
for ext in ext_list:
375-
try:
376-
pattern = r'.*\.' + ext.lstrip('.') + r'$'
377-
re.match(pattern, exe, re.I).groups()
378-
return True
379-
except AttributeError:
380-
continue
381-
return False
382-
383350
# Enhance POSIX path for the reliability at some environments, when
384351
# $PATH is changing. This also keeps order, where 'first came, first
385352
# win' for cases to find optional alternatives

0 commit comments

Comments
 (0)