(typeshed_dir: str | None, file: str)
| 888 | |
| 889 | |
| 890 | def is_stdlib_file(typeshed_dir: str | None, file: str) -> bool: |
| 891 | if "stdlib" not in file: |
| 892 | # Fast path |
| 893 | return False |
| 894 | typeshed_dir = typeshed_dir if typeshed_dir is not None else TYPESHED_DIR |
| 895 | stdlib_dir = os.path.join(typeshed_dir, "stdlib") |
| 896 | try: |
| 897 | return os.path.commonpath((stdlib_dir, os.path.abspath(file))) == stdlib_dir |
| 898 | except ValueError: # Different drives on Windows |
| 899 | return False |
| 900 | |
| 901 | |
| 902 | def is_stub_package_file(file: str) -> bool: |
no test coverage detected
searching dependent graphs…