From aa8264439271d9c8b90e55744d345d110f3a009f Mon Sep 17 00:00:00 2001 From: holger krekel Date: Sun, 14 Jul 2019 09:16:51 +0200 Subject: [PATCH] fix py27 --- python/src/deltachat/_build.py | 6 +++++- python/tox.ini | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/python/src/deltachat/_build.py b/python/src/deltachat/_build.py index ec597c8e8..651d8edde 100644 --- a/python/src/deltachat/_build.py +++ b/python/src/deltachat/_build.py @@ -5,6 +5,7 @@ import tempfile import platform import os import cffi +import shutil def ffibuilder(): @@ -66,7 +67,8 @@ def ffibuilder(): distutils.log.set_verbosity(distutils.log.INFO) cc = distutils.ccompiler.new_compiler(force=True) distutils.sysconfig.customize_compiler(cc) - with tempfile.TemporaryDirectory() as tmpdir: + tmpdir = tempfile.mkdtemp() + try: src_name = os.path.join(tmpdir, "prep.h") dst_name = os.path.join(tmpdir, "prep2.c") with open(src_name, "w") as src_fp: @@ -77,6 +79,8 @@ def ffibuilder(): macros=[('PY_CFFI', '1')]) with open(dst_name, "r") as dst_fp: builder.cdef(dst_fp.read()) + finally: + shutil.rmtree(tmpdir) builder.cdef(""" extern "Python" uintptr_t py_dc_callback( diff --git a/python/tox.ini b/python/tox.ini index 8405deb4e..68167887f 100644 --- a/python/tox.ini +++ b/python/tox.ini @@ -27,7 +27,6 @@ commands = [testenv:lint] skipsdist = True usedevelop = True -basepython = python3.5 deps = flake8 # pygments required by rst-lint