MS_WINDOWS = (sys.platform == 'win32')
-
-
-SETUP_TESTCPPEXT = support.findfile('setup_testcppext.py')
+SOURCE = os.path.join(os.path.dirname(__file__), 'extension.cpp')
+SETUP = os.path.join(os.path.dirname(__file__), 'setup.py')
@support.requires_subprocess()
def _check_build(self, std_cpp03, extension_name, python_exe):
pkg_dir = 'pkg'
os.mkdir(pkg_dir)
- shutil.copy(SETUP_TESTCPPEXT, os.path.join(pkg_dir, "setup.py"))
+ shutil.copy(SETUP, os.path.join(pkg_dir, os.path.basename(SETUP)))
+ shutil.copy(SOURCE, os.path.join(pkg_dir, os.path.basename(SOURCE)))
def run_cmd(operation, cmd):
env = os.environ.copy()
// gh-91321: Very basic C++ test extension to check that the Python C API is
// compatible with C++ and does not emit C++ compiler warnings.
+//
+// The code is only built, not executed.
// Always enable assertions
#undef NDEBUG
# compatible with C++ and does not emit C++ compiler warnings.
import os
import sys
-from test import support
from setuptools import setup, Extension
MS_WINDOWS = (sys.platform == 'win32')
-SOURCE = support.findfile('_testcppext.cpp')
+SOURCE = 'extension.cpp'
if not MS_WINDOWS:
# C++ compiler flags for GCC and clang
CPPFLAGS = [