File: python-version.patch

package info (click to toggle)
libgetdata 0.11.0-16
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,144 kB
  • sloc: ansic: 100,814; cpp: 4,843; fortran: 4,548; f90: 2,561; python: 2,406; perl: 2,274; makefile: 1,487; php: 1,465; sh: 86
file content (17 lines) | stat: -rw-r--r-- 603 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Description: Fix version identification in Makefile generation for python3.10+
Author: Alastair McKinstry <mckinstry@debian.org>
Bug-Origin: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=998682
Last-Updated: 2021-11-27
Forwarded: no

--- a/m4/python.m4
+++ b/m4/python.m4
@@ -161,7 +161,7 @@
 AC_MSG_RESULT([$have_python3])
 
 AC_MSG_CHECKING([$PYTHON version])
-PYTHON_VERSION=`$PYTHON -c "import sys; print (sys.version[[:3]])"`
+PYTHON_VERSION=`$PYTHON -c "import sys; print (f'{sys.version_info.major}.{sys.version_info.minor}')"`
 AC_MSG_RESULT([$PYTHON_VERSION])
 AC_SUBST([PYTHON_VERSION])