From 0cb3fba7b33aae669d47ea5f30a5a2bc5f21e465 Mon Sep 17 00:00:00 2001 From: Samuel Henrique <samueloph@debian.org> Date: Sat, 5 Dec 2020 20:07:58 +0000 Subject: [PATCH] d/p/python39-compat.patch: Add patch for python 3.9 compatibility --- debian/patches/python39-compat.patch | 21 +++++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 22 insertions(+) create mode 100644 debian/patches/python39-compat.patch create mode 100644 debian/patches/series diff --git a/debian/patches/python39-compat.patch b/debian/patches/python39-compat.patch new file mode 100644 index 0000000..924ed40 --- /dev/null +++ b/debian/patches/python39-compat.patch @@ -0,0 +1,21 @@ +Description: Fix import of deprecated fractions.gcd function (for python >= 3.9) +Author: Samuel Henrique <samueloph@debian.org> +Index: xcb-proto/xcbgen/align.py +=================================================================== +--- xcb-proto.orig/xcbgen/align.py ++++ xcb-proto/xcbgen/align.py +@@ -2,7 +2,13 @@ + This module contains helper classes for alignment arithmetic and checks + ''' + +-from fractions import gcd ++# python >= 3.9 compatibility ++# fractions.gcd is deprecated since python 3.9 ++# math.gcd is available since python 3.5 ++try: ++ from fractions import gcd ++except ImportError: ++ from math import gcd + + class Alignment(object): + diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..5703b40 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1 @@ +python39-compat.patch -- 2.29.2