diff options
| author | kmvanbrunt <kmvanbrunt@gmail.com> | 2018-08-01 03:57:13 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-08-01 03:57:13 -0400 |
| commit | 54cd5f7b22bade4361e507b22b68dcf69ba8dd4a (patch) | |
| tree | e2e8cb7aee957960d29dc338bf65ea6725d1c5a3 /cmd2.py | |
| parent | 3ec6cea21a97ac7adc4db4cbb809626a3fdeee7d (diff) | |
| parent | 4b2702480b99a733a1f65a60f86eedb1e6bf259a (diff) | |
| download | cmd2-git-54cd5f7b22bade4361e507b22b68dcf69ba8dd4a.tar.gz | |
Merge pull request #493 from python-cmd2/extra_slash
Fixed case where extra slash was printing when tab completing users on Windows
Diffstat (limited to 'cmd2.py')
| -rwxr-xr-x | cmd2.py | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -229,7 +229,7 @@ if six.PY2 and sys.platform.startswith('lin'): pass -__version__ = '0.8.8' +__version__ = '0.8.9' # Pyparsing enablePackrat() can greatly speed up parsing, but problems have been seen in Python 3 in the past pyparsing.ParserElement.enablePackrat() @@ -1694,12 +1694,15 @@ class Cmd(cmd.Cmd): users = [] # Windows lacks the pwd module so we can't get a list of users. - # Instead we will add a slash once the user enters text that + # Instead we will return a result once the user enters text that # resolves to an existing home directory. if sys.platform.startswith('win'): expanded_path = os.path.expanduser(text) if os.path.isdir(expanded_path): - users.append(text + os.path.sep) + user = text + if add_trailing_sep_if_dir: + user += os.path.sep + users.append(user) else: import pwd |
