Skip to content

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

@psh9508

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"]:

Metadata

Metadata

Assignees

No one assigned
    No fields configured for issues without a type.

    Projects

    Status

    Waiting for: Product Owner

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions