From d3b072b2c8db1aa23dd41d8319ebfeb902ca46cb Mon Sep 17 00:00:00 2001 From: Jan David Mol <mol@astron.nl> Date: Thu, 6 May 2021 15:08:50 +0200 Subject: [PATCH] TMSS-747: Fix deprecation warning for python 3.5+ --- LCS/PyCommon/math.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/LCS/PyCommon/math.py b/LCS/PyCommon/math.py index b461a4202bb..3dd0b351b9a 100644 --- a/LCS/PyCommon/math.py +++ b/LCS/PyCommon/math.py @@ -1,7 +1,10 @@ -from fractions import gcd +try: + from math import gcd +except ImportError: + from fractions import gcd __all__ = ["lcm"] def lcm(a, b): """ Return the Least Common Multiple of a and b. """ - return abs(a * b) / gcd(a, b) if a and b else 0 + return int(abs(a * b) / gcd(a, b) if a and b else 0) -- GitLab