mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 16:34:47 +01:00
oops; more fixes in built_ins
This commit is contained in:
parent
caad772382
commit
f94ef0cb94
1 changed files with 2 additions and 3 deletions
|
@ -146,13 +146,12 @@ def pathsearch(func, s, pymode=False):
|
|||
Takes a string and returns a list of file paths that match (regex, glob,
|
||||
or arbitrary search function).
|
||||
"""
|
||||
searchfunc = searchfunc[1:]
|
||||
if (not callable(func) or
|
||||
len(inspect.signature(func).parameters) != 1):
|
||||
error = "%r is not a known path search function"
|
||||
raise XonshError(error % searchfunc)
|
||||
o = func(pattern)
|
||||
no_match = [] if pymode else [pattern]
|
||||
o = func(s)
|
||||
no_match = [] if pymode else [s]
|
||||
return o if len(o) != 0 else no_match
|
||||
|
||||
RE_SHEBANG = re.compile(r'#![ \t]*(.+?)$')
|
||||
|
|
Loading…
Add table
Reference in a new issue