Skip to content

Commit 8890cde

Browse files
authored
Merge pull request #1172 from newrelic/fix-verison-check
Fix Environment Scraping Logic
2 parents 541d126 + 861f91c commit 8890cde

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

newrelic/core/environment.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,15 +235,16 @@ def environment_settings():
235235
continue
236236

237237
# Don't attempt to look up version information for our hooks
238+
version = None
238239
if not nr_hook:
239240
try:
240241
version = get_package_version(name)
241242
except Exception:
242-
version = None
243+
pass
243244

244245
# If it has no version it's likely not a real package so don't report it unless
245246
# it's a new relic hook.
246-
if version or nr_hook:
247+
if nr_hook or version:
247248
plugins.append("%s (%s)" % (name, version))
248249

249250
env.append(("Plugin List", plugins))

0 commit comments

Comments
 (0)