mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-02 22:48:40 +00:00
Fix #1143 deluge-console crashes when tab-completing not-existent
directory
This commit is contained in:
parent
1da79ceb75
commit
f666c28e14
1 changed files with 7 additions and 6 deletions
|
@ -105,12 +105,13 @@ class Command(BaseCommand):
|
||||||
# This path does not exist, so lets do a listdir on it's parent
|
# This path does not exist, so lets do a listdir on it's parent
|
||||||
# and find any matches.
|
# and find any matches.
|
||||||
ret = []
|
ret = []
|
||||||
for f in os.listdir(os.path.dirname(line)):
|
if os.path.isdir(os.path.dirname(line)):
|
||||||
if f.startswith(os.path.split(line)[1]):
|
for f in os.listdir(os.path.dirname(line)):
|
||||||
p = os.path.join(os.path.dirname(line), f)
|
if f.startswith(os.path.split(line)[1]):
|
||||||
|
p = os.path.join(os.path.dirname(line), f)
|
||||||
|
|
||||||
if os.path.isdir(p):
|
if os.path.isdir(p):
|
||||||
p += "/"
|
p += "/"
|
||||||
ret.append(p)
|
ret.append(p)
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue