@@ -619,25 +619,25 @@ cdef class Fraction:
619
619
cdef Py_ssize_t minimumwidth = int (match[" minimumwidth" ] or " 0" )
620
620
thousands_sep = match[" thousands_sep" ] or ' '
621
621
622
- if PY_MAJOR_VERSION < 3 :
623
- py2_thousands_sep , thousands_sep = thousands_sep, ' '
624
- cdef Py_ssize_t first_pos # Py2-only
622
+ if PY_VERSION_HEX < 0x03060000 :
623
+ legacy_thousands_sep , thousands_sep = thousands_sep, ' '
624
+ cdef Py_ssize_t first_pos # Py2/3.5 -only
625
625
626
626
# Determine the body and sign representation.
627
627
n, d = self ._numerator, self ._denominator
628
- if PY_MAJOR_VERSION < 3 and py2_thousands_sep :
628
+ if PY_VERSION_HEX < 0x03060000 and legacy_thousands_sep :
629
629
# Insert thousands separators if required.
630
630
body = str (abs (n))
631
631
first_pos = 1 + (len (body) - 1 ) % 3
632
632
body = body[:first_pos] + " " .join([
633
- py2_thousands_sep + body[pos : pos + 3 ]
633
+ legacy_thousands_sep + body[pos : pos + 3 ]
634
634
for pos in range (first_pos, len (body), 3 )
635
635
])
636
636
if d > 1 or alternate_form:
637
637
den = str (abs (d))
638
638
first_pos = 1 + (len (den) - 1 ) % 3
639
639
den = den[:first_pos] + " " .join([
640
- py2_thousands_sep + den[pos: pos + 3 ]
640
+ legacy_thousands_sep + den[pos: pos + 3 ]
641
641
for pos in range (first_pos, len (den), 3 )
642
642
])
643
643
body += " /" + den
0 commit comments