diff options
| author | Armin Rigo <arigo@tunes.org> | 2016-04-21 13:14:43 +0200 |
|---|---|---|
| committer | Armin Rigo <arigo@tunes.org> | 2016-04-21 13:14:43 +0200 |
| commit | 31f484a4719868f32a40ee72cb8b4a8a2f8f7ae3 (patch) | |
| tree | c4aadf1f096bea2e1524625257e3d6fcd4be13e0 /testing/embedding/test_basic.py | |
| parent | 79d0a6ae494118eaaeecade49e356ba49ee11a3c (diff) | |
| download | cffi-31f484a4719868f32a40ee72cb8b4a8a2f8f7ae3.tar.gz | |
Re-add this hack, removed in 51f1337c9b4c; but this time only in tests
Diffstat (limited to 'testing/embedding/test_basic.py')
| -rw-r--r-- | testing/embedding/test_basic.py | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/testing/embedding/test_basic.py b/testing/embedding/test_basic.py index 7e88bc1..4b7f3a4 100644 --- a/testing/embedding/test_basic.py +++ b/testing/embedding/test_basic.py @@ -79,8 +79,21 @@ class EmbeddingTests: # find a solution to that: we could hack sys.path inside the # script run here, but we can't hack it in the same way in # execute(). - output = self._run([sys.executable, - os.path.join(local_dir, filename)]) + pathname = os.path.join(path, filename) + with open(pathname, 'w') as g: + g.write(''' +# https://bugs.python.org/issue23246 +import sys +if sys.platform == 'win32': + try: + import setuptools + except ImportError: + pass +''') + with open(os.path.join(local_dir, filename), 'r') as f: + g.write(f.read()) + + output = self._run([sys.executable, pathname]) match = re.compile(r"\bFILENAME: (.+)").search(output) assert match dynamic_lib_name = match.group(1) |
