Skip to content

Commit

Permalink
Make sure the C ext is not build on PyPy (if it builds it would segfa…
Browse files Browse the repository at this point in the history
…ult and be broken)
  • Loading branch information
ionelmc committed Dec 13, 2023
1 parent f633fd3 commit 2f8bed2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import os
import platform
import re
import sys
from pathlib import Path

from setuptools import Extension
Expand All @@ -28,6 +29,8 @@ class OptionalBuildExt(build_ext):

def run(self):
try:
if '__pypy__' in sys.builtin_module_names:
raise Exception('C extensions are broken on PyPy!')
if os.environ.get('SETUPPY_FORCE_PURE'):
raise Exception('C extensions disabled (SETUPPY_FORCE_PURE)!')
super().run()
Expand Down

0 comments on commit 2f8bed2

Please sign in to comment.