Skip to content

Commit e46c407

Browse files
lrafeeimergify[bot]TimPansino
authored
Add attribute check (#1311)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Timothy Pansino <[email protected]>
1 parent 6a097b0 commit e46c407

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

newrelic/samplers/gc_data.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,11 @@ def enabled(self):
3737
settings = global_settings()
3838
if platform.python_implementation() == "PyPy" or not settings:
3939
return False
40-
else:
40+
# This might be inheriting from Settings instead of TopLevelSettings
41+
elif settings and hasattr(settings, "gc_runtime_metrics"):
4142
return settings.gc_runtime_metrics.enabled
43+
else:
44+
return False
4245

4346
@property
4447
def top_object_count_limit(self):

0 commit comments

Comments
 (0)