Skip to content

Commit

Permalink
🐛 Fix python 3.8.3rc1, version parsing fails #33
Browse files Browse the repository at this point in the history
  • Loading branch information
Ousret committed Feb 8, 2021
1 parent 4b555ab commit cdd0a04
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions charset_normalizer/normalizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import statistics
from encodings.aliases import aliases
from os.path import basename, splitext
from platform import python_version_tuple
from sys import version_info
from warnings import warn

from cached_property import cached_property
Expand Down Expand Up @@ -392,7 +392,7 @@ def from_bytes(sequences, steps=10, chunk_size=512, threshold=0.20, cp_isolation
excluded_list=', '.join(cp_exclusion))

# Bellow Python 3.6, Expect dict to not behave the same.
py_v = [int(el) for el in python_version_tuple()]
py_v = [int(el) for el in (version_info.major, version_info.minor, version_info.micro,)]
py_need_sort = py_v[0] < 3 or (py_v[0] == 3 and py_v[1] < 6)

supported = collections.OrderedDict(aliases).items() if py_need_sort else aliases.items()
Expand Down

0 comments on commit cdd0a04

Please sign in to comment.