Skip to content

Commit

Permalink
some logic cleanup (xonsh#3918)
Browse files Browse the repository at this point in the history
  • Loading branch information
scopatz authored Nov 19, 2020
1 parent 03fd886 commit 3a34d9f
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions xonsh/commands_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,11 @@ def all_commands(self):
allcmds[key] = (os.path.join(path, cmd), alss.get(key, None))

warn_cnt = builtins.__xonsh__.env.get("COMMANDS_CACHE_SIZE_WARNING")
if warn_cnt:
cnt = len(allcmds)
if cnt > warn_cnt:
print(
f"Warning! Found {cnt:,} executable files in the PATH directories!",
file=sys.stderr,
)
if warn_cnt and len(allcmds) > warn_cnt:
print(
f"Warning! Found {len(allcmds):,} executable files in the PATH directories!",
file=sys.stderr,
)

for cmd in alss:
if cmd not in allcmds:
Expand Down

0 comments on commit 3a34d9f

Please sign in to comment.