Skip to content

Commit

Permalink
DeprecationWarning: open_binary is deprecated.
Browse files Browse the repository at this point in the history
  • Loading branch information
khaledhosny committed Feb 17, 2024
1 parent 1f863f6 commit 7716f36
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Lib/glyphsLib/glyphdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,13 @@ def get_glyph(glyph_name, data=None, unicodes=None):
if data is None:
global GLYPHDATA
if GLYPHDATA is None:
from importlib.resources import open_binary
from importlib.resources import files

with open_binary("glyphsLib.data", "GlyphData.xml") as f1:
with open_binary("glyphsLib.data", "GlyphData_Ideographs.xml") as f2:
data_dir = files("glyphsLib.data")
with (data_dir / "GlyphData.xml").open("rb") as f1:
with (data_dir / "GlyphData_Ideographs.xml").open("rb") as f2:
GLYPHDATA = GlyphData.from_files(f1, f2)

data = GLYPHDATA

# Look up data by full glyph name first.
Expand Down

0 comments on commit 7716f36

Please sign in to comment.