Skip to content

Commit 13fc2c4

Browse files
authored
fix permision error issue (#529)
fix permission error when /usr/bin permission is 111 or /usr/local/bin is missing
1 parent fe1bfc6 commit 13fc2c4

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

nemo-compare/src/utils.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,10 @@ def add_missing_predefined_engines(self):
111111
'''Adds predefined engines which are installed, but missing in engines list.'''
112112
system_utils = []
113113
for path in COMPARATOR_PATHS:
114-
system_utils += os.listdir(path)
114+
try:
115+
system_utils += os.listdir(path)
116+
except:
117+
pass
115118
for engine in PREDEFINED_ENGINES:
116119
if engine not in self.engines and engine in system_utils:
117120
self.engines.append(engine)
@@ -138,7 +141,10 @@ def save(self):
138141

139142
system_utils = []
140143
for path in COMPARATOR_PATHS:
141-
system_utils += os.listdir(path)
144+
try:
145+
system_utils += os.listdir(path)
146+
except:
147+
pass
142148
for engine in self.engines:
143149
if engine not in system_utils:
144150
self.engines.remove(engine)

0 commit comments

Comments
 (0)