google / emboss

Emboss is a tool for generating code that reads and writes binary data structures.
Apache License 2.0
72 stars 22 forks source link

Use math.gcd or fractions.gcd depending on what is available #15

Closed jadmanski closed 3 years ago

jadmanski commented 3 years ago

Replace usage of fractions.gcd with a conditional that uses math.gcd if it is available and which falls back to fractions.gcd if it is not. This allows the code to work in Python 3.9+ where the deprecated fractions.gcd function was removed.

If support for versions of Python older than 3.5 is dropped then this code could be simplified to just use math.gcd.