Skip to content

Commit

Permalink
Fix glob
Browse files Browse the repository at this point in the history
Fixes #708

glob.glob has many possible arguments but the current wrapping solution
doesn't cover all them.

This change directly passes all args (positional and kw) as-is to the
wrapped function.
  • Loading branch information
Pistahh committed Nov 20, 2023
1 parent 11ea5c8 commit 2aca0fc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sh.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,12 +457,12 @@ def __init__(self, path, results):
list.__init__(self, results)


def glob(path, recursive=False):
expanded = GlobResults(path, _old_glob(path, recursive=recursive))
def glob(path, *args, **kwargs):
expanded = GlobResults(path, _old_glob(path, *args, **kwargs))
return expanded


glob_module.glob = glob
glob_module.glob = glob # type: ignore


def canonicalize(path):
Expand Down

0 comments on commit 2aca0fc

Please sign in to comment.