From 22af8e782bed98e4b4f71617c9b905dd37e7c3f3 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Tue, 29 Dec 2020 18:23:54 +0900 Subject: [PATCH] Require python3 for python bindings --- configure.ac | 4 ++-- python/Makefile.am | 2 +- python/hpackcheck.py | 2 +- python/hpackmake.py | 2 +- python/nghttp2.pyx | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/configure.ac b/configure.ac index 086526b2..a26b4d81 100644 --- a/configure.ac +++ b/configure.ac @@ -151,7 +151,7 @@ AC_PROG_MKDIR_P PKG_PROG_PKG_CONFIG([0.20]) -AM_PATH_PYTHON([2.7],, [:]) +AM_PATH_PYTHON([3.8],, [:]) if [test "x$request_lib_only" = "xyes"]; then request_app=no @@ -161,7 +161,7 @@ if [test "x$request_lib_only" = "xyes"]; then fi if [test "x$request_python_bindings" != "xno"]; then - AX_PYTHON_DEVEL([>= '2.7']) + AX_PYTHON_DEVEL([>= '3.8']) fi if test "x${cython_path}" = "x"; then diff --git a/python/Makefile.am b/python/Makefile.am index 2d2edd5a..75eb7a05 100644 --- a/python/Makefile.am +++ b/python/Makefile.am @@ -44,6 +44,6 @@ clean-local: -rm -f $(builddir)/nghttp2.c .pyx.c: - $(CYTHON) -o $@ $< + $(CYTHON) -3 -o $@ $< endif # ENABLE_PYTHON_BINDINGS diff --git a/python/hpackcheck.py b/python/hpackcheck.py index 64d2851d..41a8322e 100755 --- a/python/hpackcheck.py +++ b/python/hpackcheck.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # This script reads json files given in the command-line (each file # must be written in the format described in diff --git a/python/hpackmake.py b/python/hpackmake.py index 208c0e1d..a96bbe58 100755 --- a/python/hpackmake.py +++ b/python/hpackmake.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # This script reads input headers from json file given in the # command-line (each file must be written in the format described in diff --git a/python/nghttp2.pyx b/python/nghttp2.pyx index 7821ff14..c374d786 100644 --- a/python/nghttp2.pyx +++ b/python/nghttp2.pyx @@ -857,7 +857,7 @@ cdef class _HTTP2SessionCore(_HTTP2SessionCoreBase): rv = cnghttp2.nghttp2_submit_settings(self.session, cnghttp2.NGHTTP2_FLAG_NONE, - iv, sizeof(iv) / sizeof(iv[0])) + iv, sizeof(iv) // sizeof(iv[0])) if rv != 0: raise Exception('nghttp2_submit_settings failed: {}'.format\ @@ -971,7 +971,7 @@ cdef class _HTTP2ClientSessionCore(_HTTP2SessionCoreBase): rv = cnghttp2.nghttp2_submit_settings(self.session, cnghttp2.NGHTTP2_FLAG_NONE, - iv, sizeof(iv) / sizeof(iv[0])) + iv, sizeof(iv) // sizeof(iv[0])) if rv != 0: raise Exception('nghttp2_submit_settings failed: {}'.format\