Skip to content

Commit 46a2651

Browse files
authored
Merge pull request #24 from elgris/23-problem-with-pyasn1
ignores weird modules
2 parents 75b596e + 0885d15 commit 46a2651

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

instana/meter.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -195,13 +195,17 @@ 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+
r[k] = "unknown"
208+
l.error("collect_modules: could not process module ", k, str(e))
205209

206210
return r
207211
except Exception as e:

0 commit comments

Comments
 (0)