Skip to content

Remove deepcopy #173

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions honeybadger/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import copy
import json


Expand All @@ -11,13 +10,11 @@ def default(self, o):


def filter_dict(data, filter_keys):
# filter_keys = set(data.keys())
if type(data) != dict:
return data

data_copy = copy.deepcopy(data)

for key, value in data_copy.items():
keys = list(data.keys())
for key in keys:
# While tuples are considered valid dictionary keys,
# they are not json serializable
# so we remove them from the dictionary
Expand All @@ -28,7 +25,7 @@ def filter_dict(data, filter_keys):
if key in filter_keys:
data[key] = "[FILTERED]"

if type(value) == dict:
if type(data[key]) == dict:
data[key] = filter_dict(data[key], filter_keys)

return data
Loading