File tree 2 files changed +59
-1
lines changed 2 files changed +59
-1
lines changed Original file line number Diff line number Diff line change @@ -254,7 +254,9 @@ def fixup(self, node: SN) -> SN:
254
254
def fixup_type (self , typ : Type ) -> None :
255
255
typ .accept (TypeReplaceVisitor (self .replacements ))
256
256
257
- def process_type_info (self , info : TypeInfo ) -> None :
257
+ def process_type_info (self , info : Optional [TypeInfo ]) -> None :
258
+ if info is None :
259
+ return
258
260
# TODO: Additional things:
259
261
# - declared_metaclass
260
262
# - metaclass_type
Original file line number Diff line number Diff line change @@ -1861,3 +1861,59 @@ def f() -> None:
1861
1861
[out]
1862
1862
a.py:1: error: Need type annotation for 'y'
1863
1863
==
1864
+
1865
+ [case testSkippedClass1]
1866
+ import a
1867
+ [file a.py]
1868
+ class A: pass
1869
+ [file a.py.2]
1870
+ import sys
1871
+ if sys.platform == 'xyz':
1872
+ class A: pass
1873
+ [builtins fixtures/ops.pyi]
1874
+ [out]
1875
+ ==
1876
+
1877
+ [case testSkippedClass2]
1878
+ import a
1879
+ [file a.py]
1880
+ import sys
1881
+ if sys.platform == 'xyz':
1882
+ class A: pass
1883
+ [file a.py.2]
1884
+ import sys
1885
+ if sys.platform == 'xyz':
1886
+ class A: pass
1887
+ [builtins fixtures/ops.pyi]
1888
+ [out]
1889
+ ==
1890
+
1891
+ [case testSkippedClass3]
1892
+ import a
1893
+ [file a.py]
1894
+ import sys
1895
+ if sys.platform == 'xyz':
1896
+ class A: pass
1897
+ [file a.py.2]
1898
+ class A: pass
1899
+ [builtins fixtures/ops.pyi]
1900
+ [out]
1901
+ ==
1902
+
1903
+ [case testSkippedClass4]
1904
+ import a
1905
+ [file a.py]
1906
+ import sys
1907
+ if sys.platform == 'xyz':
1908
+ class A: pass
1909
+ else:
1910
+ class A: pass
1911
+ [file a.py.2]
1912
+ import sys
1913
+ if sys.platform == 'xyz':
1914
+ class A: pass
1915
+ else:
1916
+ class A: pass
1917
+ [builtins fixtures/ops.pyi]
1918
+ [out]
1919
+ ==
You can’t perform that action at this time.
0 commit comments