Skip to content

Python: False positive in python/Statements/UnreachableCode #1212

@Anthchirp

Description

@Anthchirp

Example:
https://lgtm.com/projects/g/dials/data/snapshot/5649de308532bce681716dc8235a851850c93bcd/files/dials_data/download.py#x29a04cee487f283d:1

In the snippet

try:
  import fcntl
except ImportError:
  pass

the except path is incorrectly identified as unreachable code. fcntl is a standard library module, but not present on Python for Windows.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions