Commit 6528682e authored by Stefan Behnel's avatar Stefan Behnel

reformat some code

parent fd38977b
...@@ -110,8 +110,7 @@ class Context(object): ...@@ -110,8 +110,7 @@ class Context(object):
def nonfatal_error(self, exc): def nonfatal_error(self, exc):
return Errors.report_error(exc) return Errors.report_error(exc)
def find_module(self, module_name, def find_module(self, module_name, relative_to=None, pos=None, need_pxd=1, check_module_name=True):
relative_to = None, pos = None, need_pxd = 1, check_module_name = True):
# Finds and returns the module scope corresponding to # Finds and returns the module scope corresponding to
# the given relative or absolute module name. If this # the given relative or absolute module name. If this
# is the first time the module has been requested, finds # is the first time the module has been requested, finds
...@@ -129,8 +128,7 @@ class Context(object): ...@@ -129,8 +128,7 @@ class Context(object):
if check_module_name and not module_name_pattern.match(module_name): if check_module_name and not module_name_pattern.match(module_name):
if pos is None: if pos is None:
pos = (module_name, 0, 0) pos = (module_name, 0, 0)
raise CompileError(pos, raise CompileError(pos, "'%s' is not a valid module name" % module_name)
"'%s' is not a valid module name" % module_name)
if relative_to: if relative_to:
if debug_find_module: if debug_find_module:
print("...trying relative import") print("...trying relative import")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment