Skip to content

Commit

Permalink
Fix crash in FastFilesCompleter with no prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
evanunderscore committed Sep 4, 2017
1 parent 181bd60 commit 4ead5c7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions _pytest/_argcomplete.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ def __call__(self, prefix, **kwargs):
completion = []
globbed = []
if '*' not in prefix and '?' not in prefix:
if prefix[-1] == os.path.sep: # we are on unix, otherwise no bash
# we are on unix, otherwise no bash
if prefix and prefix[-1] == os.path.sep:
globbed.extend(glob(prefix + '.*'))
prefix += '*'
globbed.extend(glob(prefix))
Expand All @@ -98,7 +99,7 @@ def __call__(self, prefix, **kwargs):
filescompleter = FastFilesCompleter()

def try_argcomplete(parser):
argcomplete.autocomplete(parser)
argcomplete.autocomplete(parser, always_complete_options=False)
else:
def try_argcomplete(parser):
pass
Expand Down
1 change: 1 addition & 0 deletions changelog/2748.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix crash in tab completion when no prefix is given.

0 comments on commit 4ead5c7

Please sign in to comment.