Lines Matching refs:package
6 def _resolve_name(name, package, level):
8 if not hasattr(package, 'rindex'):
9 raise ValueError("'package' not set to a string")
10 dot = len(package)
13 dot = package.rindex('.', 0, dot)
16 "package")
17 return "%s.%s" % (package[:dot], name)
20 def import_module(name, package=None):
23 The 'package' argument is required when performing a relative import. It
24 specifies the package to use as the anchor point from which to resolve the
29 if not package:
30 raise TypeError("relative imports require the 'package' argument")
36 name = _resolve_name(name[level:], package, level)