File tree Expand file tree Collapse file tree 1 file changed +0
-33
lines changed Expand file tree Collapse file tree 1 file changed +0
-33
lines changed Original file line number Diff line number Diff line change 1111import re
1212import subprocess
1313from distutils .version import StrictVersion
14- from functools import wraps
1514
1615from . import exc
1716from ._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-
347331def 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
You can’t perform that action at this time.
0 commit comments