JHUISI / charm

Charm: A Framework for Rapidly Prototyping Cryptosystems
http://charm-crypto.io
GNU Lesser General Public License v3.0
552 stars 167 forks source link

Use math.gcd instead of fractions.gcd #226

Closed lenerd closed 5 years ago

lenerd commented 5 years ago

Hi there, while running the charm test I got the following warning (see also Python documentation):

DeprecationWarning: fractions.gcd() is deprecated. Use math.gcd()
instead.

This PR makes the according changes to use math.gcd.

jakinyele commented 5 years ago

@lenerd How about support for py3.4 or below? math.gcd is not available. Please add a check to import

lenerd commented 5 years ago

Should have thought about this, sorry ... I have added guards for the imports.

Note that the recently released version 5.0 of pytest only supports Python 3.5 and newer. Tu run tests in a virtual environment with an older Python version, I had to specify pytest<=4.6 in the setup.py.