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
...@@ -122,15 +121,14 @@ class Context(object): ...@@ -122,15 +121,14 @@ class Context(object):
debug_find_module = 0 debug_find_module = 0
if debug_find_module: if debug_find_module:
print("Context.find_module: module_name = %s, relative_to = %s, pos = %s, need_pxd = %s" % ( print("Context.find_module: module_name = %s, relative_to = %s, pos = %s, need_pxd = %s" % (
module_name, relative_to, pos, need_pxd)) module_name, relative_to, pos, need_pxd))
scope = None scope = None
pxd_pathname = None pxd_pathname = None
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