Skip to content

Commit 68c6cb3

Browse files
author
Ivan Kirichenko
committed
ignores weird modules
1 parent 75b596e commit 68c6cb3

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

instana/meter.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -195,13 +195,16 @@ def collect_modules(self):
195195
r = {}
196196
for k in m:
197197
if m[k]:
198-
d = m[k].__dict__
199-
if "version" in d and d["version"]:
200-
r[k] = self.jsonable(d["version"])
201-
elif "__version__" in d and d["__version__"]:
202-
r[k] = self.jsonable(d["__version__"])
203-
else:
204-
r[k] = "builtin"
198+
try:
199+
d = m[k].__dict__
200+
if "version" in d and d["version"]:
201+
r[k] = self.jsonable(d["version"])
202+
elif "__version__" in d and d["__version__"]:
203+
r[k] = self.jsonable(d["__version__"])
204+
else:
205+
r[k] = "builtin"
206+
except Exception as e:
207+
l.error("collect_modules: could not process module ", k, str(e))
205208

206209
return r
207210
except Exception as e:

0 commit comments

Comments
 (0)