File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed
sentry_sdk/integrations/django Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -695,15 +695,10 @@ def _set_db_data(span, cursor_or_db):
695
695
if is_psycopg2 :
696
696
connection_params = cursor_or_db .connection .get_dsn_parameters ()
697
697
else :
698
- is_psycopg3 = (
699
- hasattr (cursor_or_db , "connection" )
700
- and hasattr (cursor_or_db .connection , "info" )
701
- and hasattr (cursor_or_db .connection .info , "get_parameters" )
702
- and inspect .isroutine (cursor_or_db .connection .info .get_parameters )
703
- )
704
- if is_psycopg3 :
698
+ try :
699
+ # psycopg3
705
700
connection_params = cursor_or_db .connection .info .get_parameters ()
706
- else :
701
+ except Exception :
707
702
connection_params = db .get_connection_params ()
708
703
709
704
db_name = connection_params .get ("dbname" ) or connection_params .get ("database" )
You can’t perform that action at this time.
0 commit comments