Skip to content

Commit

Permalink
Merge pull request #63 from Mathics3/remove-3.12-deprecation-warning
Browse files Browse the repository at this point in the history
Remove 3.12 deprecation warning...
  • Loading branch information
rocky authored Jul 26, 2024
2 parents 3c65969 + 24e049b commit 3244783
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ inputrc-unicode:

#: Run Mathics core checks
check-mathics::
$(PYTHON) -m mathics.docpipeline $o
MATHICS_CHARACTER_ENCODING="ASCII" $(PYTHON) -m mathics.docpipeline $o

#: Remove ChangeLog
rmChangeLog:
Expand Down
14 changes: 10 additions & 4 deletions mathics_scanner/characters.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,25 @@
and Unicode/ASCII.
"""

import re
import os
import pkg_resources
import os.path as osp
import re

try:
import ujson
except ImportError:
import json as ujson

ROOT_DIR = pkg_resources.resource_filename("mathics_scanner", "")

def get_srcdir() -> str:
filename = osp.normcase(osp.dirname(osp.abspath(__file__)))
return osp.realpath(filename)


ROOT_DIR = get_srcdir()

# Load the conversion tables from disk
characters_path = os.path.join(ROOT_DIR, "data", "characters.json")
characters_path = osp.join(ROOT_DIR, "data", "characters.json")
if os.path.exists(characters_path):
with open(characters_path, "r") as f:
_data = ujson.load(f)
Expand Down

0 comments on commit 3244783

Please sign in to comment.