mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-23 13:10:18 +08:00
MAINT: address review comments
This commit is contained in:
+6
-4
@@ -85,10 +85,12 @@ def process_tempita_pyx(fromfile):
|
||||
except ImportError:
|
||||
raise Exception('Building requires Tempita: '
|
||||
'pip install --user Tempita')
|
||||
from_filename = tempita.Template.from_filename
|
||||
template = from_filename(fromfile, encoding=sys.getdefaultencoding())
|
||||
template = tempita.Template.from_filename(fromfile,
|
||||
encoding=sys.getdefaultencoding())
|
||||
pyxcontent = template.substitute()
|
||||
assert fromfile.endswith('.pyx.in')
|
||||
pyxfile = fromfile[:-len('.pyx.in')] + '.pyx'
|
||||
if not fromfile.endswith('.pyx.in'):
|
||||
raise ValueError("Unexpected extension of %s." % fromfile)
|
||||
|
||||
pyxfile = os.path.splitext(fromfile)[0] + '.pyx'
|
||||
with open(pyxfile, "w") as f:
|
||||
f.write(pyxcontent)
|
||||
|
||||
Reference in New Issue
Block a user