ref(transport): Simplify redundant DSN check in Transport.__init__ · Issue #6089 · getsentry/sentry-python · GitHub
Skip to content

ref(transport): Simplify redundant DSN check in Transport.__init__ #6089

Description

@psh9508

In Transport.init (transport.py#L109), the DSN check contains a redundant is not None guard:                                     
   
if options and options["dsn"] is not None and options["dsn"]:                                                                        
                                                                                         
The is not None check is unnecessary — the subsequent truthiness check already evaluates None as falsy, making it redundant.         
                                                                                         
This is also inconsistent with the existing pattern later in the same file:                                                          
                                                                                         
transport.py L1165                                                                                                                 
if options["dsn"]:

Suggested Change

  • if options and options["dsn"] is not None and options["dsn"]:
  • if options and options["dsn"]:

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions