Skip to content

Commit 17677fc

Browse files
committed
Print error conditionally
1 parent 943d04a commit 17677fc

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

mypy/build.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,15 @@
4343
try:
4444
from librt.internal import cache_version
4545
except ImportError:
46-
print(
47-
"Running mypy on PyPy is not supported yet."
48-
"To type-check a PyPy library please run mypy on an equivalent CPython version,"
49-
"see https://github.com/mypyc/librt/issues/16 for possible workarounds."
50-
)
51-
sys.exit(2)
46+
if platform.python_implementation() == "PyPy":
47+
print(
48+
"Running mypy on PyPy is not supported yet."
49+
"To type-check a PyPy library please run mypy on an equivalent CPython version,"
50+
"see https://github.com/mypyc/librt/issues/16 for possible workarounds."
51+
)
52+
sys.exit(2)
53+
else:
54+
raise
5255

5356
import mypy.semanal_main
5457
from mypy.cache import CACHE_VERSION, CacheMeta, ReadBuffer, WriteBuffer, write_json

0 commit comments

Comments
 (0)