Skip to content

Commit

Permalink
Fix python 2 type validation
Browse files Browse the repository at this point in the history
  • Loading branch information
TimPansino committed Mar 29, 2023
1 parent 45f6896 commit 283de53
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions newrelic/api/time_trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,8 +435,8 @@ def notice_error(self, error=None, attributes=None, expected=None, ignore=None,
})
if error_group_name_raw:
_, error_group_name = process_user_attribute("error.group.name", error_group_name_raw)
if error_group_name is None or not isinstance(error_group_name, six.text_type):
raise ValueError("Invalid attribute value for error.group.name. Expected string, got: %s" % str(error_group_name_raw))
if error_group_name is None or not isinstance(error_group_name, six.string_types):
raise ValueError("Invalid attribute value for error.group.name. Expected string, got: %s" % repr(error_group_name_raw))
except Exception:
_logger.error("Encountered error when calling error group callback:\n%s", "".join(traceback.format_exception(*sys.exc_info())))
error_group_name = None
Expand Down
4 changes: 2 additions & 2 deletions newrelic/core/stats_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -742,8 +742,8 @@ def notice_error(self, error=None, attributes=None, expected=None, ignore=None,
})
if error_group_name_raw:
_, error_group_name = process_user_attribute("error.group.name", error_group_name_raw)
if error_group_name is None or not isinstance(error_group_name, six.text_type):
raise ValueError("Invalid attribute value for error.group.name. Expected string, got: %s" % str(error_group_name_raw))
if error_group_name is None or not isinstance(error_group_name, six.string_types):
raise ValueError("Invalid attribute value for error.group.name. Expected string, got: %s" % repr(error_group_name_raw))
else:
agent_attributes["error.group.name"] = error_group_name

Expand Down

0 comments on commit 283de53

Please sign in to comment.