Commit 5b5ab5cf authored by Alexey Sokolov's avatar Alexey Sokolov

Support python 3.9

Fix #1702
parent 0af3c4b2
......@@ -196,14 +196,19 @@ if (WANT_PYTHON)
message(FATAL_ERROR "Invalid value of WANT_PYTHON_VERSION")
endif()
endif()
# Compatibility with pkg-config variables
set(Python3_LDFLAGS "${Python3_LIBRARIES}")
if (Python3_FOUND AND Python3_VERSION VERSION_LESS 3.3)
message(STATUS "Python too old, need at least 3.3")
set(Python3_FOUND OFF)
else()
# Compatibility with pkg-config variables
set(Python3_LDFLAGS "${Python3_LIBRARIES}")
endif()
endif()
if (NOT Python3_FOUND AND WANT_PYTHON_VERSION MATCHES "^python")
# Since python 3.8, -embed is required for embedding.
pkg_check_modules(Python3 "${WANT_PYTHON_VERSION}-embed >= 3.0")
pkg_check_modules(Python3 "${WANT_PYTHON_VERSION}-embed >= 3.3")
if (NOT Python3_FOUND)
pkg_check_modules(Python3 "${WANT_PYTHON_VERSION} >= 3.0")
pkg_check_modules(Python3 "${WANT_PYTHON_VERSION} >= 3.3")
endif()
endif()
if (NOT Python3_FOUND)
......
......@@ -43,7 +43,7 @@ modperl:
* SWIG if building from git
modpython:
* python3 and its bundled libpython
* python 3.3+ and its bundled libpython
* perl is a build dependency
* macOS: Python from Homebrew is preferred over system version
* SWIG if building from git
......
......@@ -570,8 +570,8 @@ if test "x$PYTHON" != "xno"; then
if test -z "$PKG_CONFIG"; then
AC_MSG_ERROR([pkg-config is required for modpython.])
fi
PKG_CHECK_MODULES([python], [$PYTHON-embed >= 3.0],, [
PKG_CHECK_MODULES([python], [$PYTHON >= 3.0],, AC_MSG_ERROR([$PYTHON.pc not found or is wrong. Try --disable-python or install python3.]))
PKG_CHECK_MODULES([python], [$PYTHON-embed >= 3.3],, [
PKG_CHECK_MODULES([python], [$PYTHON >= 3.3],, AC_MSG_ERROR([$PYTHON.pc not found or is wrong. Try --disable-python or install python3.]))
])
my_saved_LIBS="$LIBS"
my_saved_CXXFLAGS="$CXXFLAGS"
......
......@@ -25,7 +25,7 @@ from functools import wraps
import imp
import re
import traceback
import collections
import collections.abc
from znc_core import *
......@@ -125,7 +125,7 @@ class Timer:
pass
class ModuleNVIter(collections.Iterator):
class ModuleNVIter(collections.abc.Iterator):
def __init__(self, cmod):
self._cmod = cmod
self.it = cmod.BeginNV_()
......@@ -138,7 +138,7 @@ class ModuleNVIter(collections.Iterator):
return res
class ModuleNV(collections.MutableMapping):
class ModuleNV(collections.abc.MutableMapping):
def __init__(self, cmod):
self._cmod = cmod
......@@ -957,7 +957,7 @@ CModule.AddSocket = FreeOwnership(func=CModule.AddSocket)
CModule.AddSubPage = FreeOwnership(func=CModule.AddSubPage)
class ModulesIter(collections.Iterator):
class ModulesIter(collections.abc.Iterator):
def __init__(self, cmod):
self._cmod = cmod
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment