File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change 37
37
38
38
from threading import Lock
39
39
from collections import defaultdict , OrderedDict
40
- from importlib .resources import open_text
40
+ import importlib .resources as importlib_resources
41
41
42
42
from .definitions import BIN_Tuple
43
43
@@ -311,10 +311,11 @@ def initialize():
311
311
return
312
312
313
313
section = None
314
- config = open_text (
315
- package = "tokenizer" , resource = "Abbrev.conf" , encoding = "utf-8"
316
- ) # TODO: Deprecated in Python 3.13
317
- for s in config :
314
+
315
+ p = importlib_resources .files ("tokenizer" ).joinpath ("Abbrev.conf" )
316
+ config = p .read_text (encoding = "utf-8" )
317
+
318
+ for s in config .split ("\n " ):
318
319
# Ignore comments
319
320
ix = s .find ("#" )
320
321
if ix >= 0 :
Original file line number Diff line number Diff line change @@ -1923,7 +1923,7 @@ def parse_mixed(
1923
1923
1924
1924
# Check for currency abbreviations immediately followed by a number
1925
1925
if len (rt .txt ) > 3 and rt .txt [0 :3 ] in CURRENCY_ABBREV and rt .txt [3 ].isdigit ():
1926
- # XXX : This feels a little hacky
1926
+ # TODO : This feels a little hacky
1927
1927
temp_tok = Tok (TOK .RAW , rt .txt [3 :], None )
1928
1928
digit_tok , _ = parse_digits (temp_tok , convert_numbers )
1929
1929
if digit_tok .kind == TOK .NUMBER :
You can’t perform that action at this time.
0 commit comments