mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 01:16:31 +03:00
fix py27
This commit is contained in:
@@ -5,6 +5,7 @@ import tempfile
|
|||||||
import platform
|
import platform
|
||||||
import os
|
import os
|
||||||
import cffi
|
import cffi
|
||||||
|
import shutil
|
||||||
|
|
||||||
|
|
||||||
def ffibuilder():
|
def ffibuilder():
|
||||||
@@ -66,7 +67,8 @@ def ffibuilder():
|
|||||||
distutils.log.set_verbosity(distutils.log.INFO)
|
distutils.log.set_verbosity(distutils.log.INFO)
|
||||||
cc = distutils.ccompiler.new_compiler(force=True)
|
cc = distutils.ccompiler.new_compiler(force=True)
|
||||||
distutils.sysconfig.customize_compiler(cc)
|
distutils.sysconfig.customize_compiler(cc)
|
||||||
with tempfile.TemporaryDirectory() as tmpdir:
|
tmpdir = tempfile.mkdtemp()
|
||||||
|
try:
|
||||||
src_name = os.path.join(tmpdir, "prep.h")
|
src_name = os.path.join(tmpdir, "prep.h")
|
||||||
dst_name = os.path.join(tmpdir, "prep2.c")
|
dst_name = os.path.join(tmpdir, "prep2.c")
|
||||||
with open(src_name, "w") as src_fp:
|
with open(src_name, "w") as src_fp:
|
||||||
@@ -77,6 +79,8 @@ def ffibuilder():
|
|||||||
macros=[('PY_CFFI', '1')])
|
macros=[('PY_CFFI', '1')])
|
||||||
with open(dst_name, "r") as dst_fp:
|
with open(dst_name, "r") as dst_fp:
|
||||||
builder.cdef(dst_fp.read())
|
builder.cdef(dst_fp.read())
|
||||||
|
finally:
|
||||||
|
shutil.rmtree(tmpdir)
|
||||||
|
|
||||||
builder.cdef("""
|
builder.cdef("""
|
||||||
extern "Python" uintptr_t py_dc_callback(
|
extern "Python" uintptr_t py_dc_callback(
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ commands =
|
|||||||
[testenv:lint]
|
[testenv:lint]
|
||||||
skipsdist = True
|
skipsdist = True
|
||||||
usedevelop = True
|
usedevelop = True
|
||||||
basepython = python3.5
|
|
||||||
deps =
|
deps =
|
||||||
flake8
|
flake8
|
||||||
# pygments required by rst-lint
|
# pygments required by rst-lint
|
||||||
|
|||||||
Reference in New Issue
Block a user