Missing re module error

2 views
Skip to first unread message

Martin Pengelly-Phillips

unread,
Mar 2, 2010, 9:58:32 PM3/2/10
to mem-users
Hey,

Looking into this cool new idea for a build system. Running it against
the hello-1 example gives an error though: NameError: name 're' is not
defined.

This is caused by the CythonBuilder try/except block at the top in
which import re is included after cython, but re is always later used
in the class definition for CythonBuilder causing the error if cython
not available.

class CythonBuilder(object):
# The regular expression was stolen from the sage setup.py
_DEP_REGS_PXD = [
re.compile(r'^ *(?:cimport +([\w\. ,]+))', re.M),
re.compile(r'^ *(?:from +([\w.]+) +cimport)', re.M),
]

Moving import re above import cython fixes the problem.

Martin

ps. wasn't sure where to post so have also posted this on github
issues.

Reply all
Reply to author
Forward
0 new messages