Skip to content

Commit 26bfd97

Browse files
committed
font-patcher: Correct path handling
[why] Although Python can handle a mixture of Windows and Posix path separators we should use the system one if possible. [how] Use os.join() Signed-off-by: Fini Jastrow <[email protected]>
1 parent 1bef597 commit 26bfd97

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

font-patcher

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ except ImportError:
3838
)
3939
)
4040

41-
sys.path.insert(0, os.path.abspath(os.path.dirname(sys.argv[0])) + '/bin/scripts/name_parser/')
41+
sys.path.insert(0, os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])), 'bin', 'scripts', 'name_parser'))
4242
try:
4343
from FontnameParser import FontnameParser
4444
from FontnameTools import FontnameTools
@@ -321,7 +321,7 @@ def create_filename(fonts):
321321
def fetch_glyphnames():
322322
""" Read the glyphname database and put it into a dictionary """
323323
try:
324-
glyphnamefile = os.path.abspath(os.path.dirname(sys.argv[0])) + '/glyphnames.json'
324+
glyphnamefile = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), 'glyphnames.json'))
325325
with open(glyphnamefile, 'r') as f:
326326
namelist = json.load(f)
327327
return { int(v['code'], 16): k for k, v in namelist.items() if 'code' in v }

0 commit comments

Comments
 (0)