Skip to content

Commit

Permalink
Fix python2.7 support for dirtop tool
Browse files Browse the repository at this point in the history
* Catch TypeError raised by Python3 glob and fall back to Python2 interface
  • Loading branch information
willfindlay authored and yonghong-song committed Oct 16, 2020
1 parent 6929626 commit 1efba05
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tools/dirtop.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,10 @@ def get_searched_ids(root_directories):
inodes = "{"
total_dirs = 0
for root_directory in root_directories.split(','):
searched_dirs = glob(root_directory, recursive=True)
try:
searched_dirs = glob(root_directory, recursive=True)
except TypeError:
searched_dirs = glob(root_directory)
if not searched_dirs:
continue

Expand Down

0 comments on commit 1efba05

Please sign in to comment.