Skip to content

Commit

Permalink
fixup! Replace string literals with a call to format() - part of kakao#5
Browse files Browse the repository at this point in the history
.
  • Loading branch information
cynthia committed Dec 5, 2018
1 parent a0cfeb3 commit 46904dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/python/khaiii/khaiii.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def __init__(self, lib_path: str = ''):
if not lib_path:
ext = 'dylib' if platform.system() == 'Darwin' else 'so'
lib_name = 'libkhaiii.{ext}'.format(**locals())
lib_dir = '{os.path.dirname(__file__)}/lib'.format(**locals())
lib_dir = os.path.join(os.path.dirname(__file__), 'lib')
lib_path = '{lib_dir}/{lib_name}'.format(**locals())
if not os.path.exists(lib_path):
lib_path = find_library(lib_name)
Expand Down Expand Up @@ -191,7 +191,7 @@ def open(self, rsc_dir: str = '', opt_str: str = ''):
"""
self.close()
if not rsc_dir:
rsc_dir = '{os.path.dirname(__file__)}/share/khaiii'.format(**locals())
rsc_dir = os.path.join(os.path.dirname(__file__), 'share/khaiii')
self._handle = self._lib.khaiii_open(rsc_dir.encode('UTF-8'), opt_str.encode('UTF-8'))
if self._handle < 0:
raise KhaiiiExcept(self._last_error())
Expand Down

0 comments on commit 46904dd

Please sign in to comment.