Skip to content

Commit

Permalink
python 3.10 compat
Browse files Browse the repository at this point in the history
  • Loading branch information
exterm committed Nov 4, 2023
1 parent d12379f commit 0377cb8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions shifterator/helper.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import collections
import pkgutil
try:
from collections.abc import Mapping
except ImportError:
from collections import Mapping



def preprocess_words_scores(type2freq_1, type2score_1, type2freq_2, type2score_2,
Expand Down Expand Up @@ -153,7 +157,7 @@ def get_score_dictionary(scores):
type2score: dict
Keys are types and values are scores of those types
"""
if isinstance(scores, collections.Mapping):
if isinstance(scores, Mapping):
return scores.copy(), None

# Else, load scores from predefined score file in shifterator
Expand Down

0 comments on commit 0377cb8

Please sign in to comment.