MCPcopy Index your code
hub / github.com/python/cpython / resolve

Method resolve

Lib/logging/config.py:393–412  ·  view source on GitHub ↗

Resolve strings to objects using standard import and attribute syntax.

(self, s)

Source from the content-addressed store, hash-verified

391 self.config.configurator = self
392
393 def resolve(self, s):
394 """
395 Resolve strings to objects using standard import and attribute
396 syntax.
397 """
398 name = s.split('.')
399 used = name.pop(0)
400 try:
401 found = self.importer(used)
402 for frag in name:
403 used += '.' + frag
404 try:
405 found = getattr(found, frag)
406 except AttributeError:
407 self.importer(used)
408 found = getattr(found, frag)
409 return found
410 except ImportError as e:
411 v = ValueError('Cannot resolve %r: %s' % (s, e))
412 raise v from e
413
414 def ext_convert(self, value):
415 """Default converter for the ext:// protocol."""

Callers 3

ext_convertMethod · 0.95
configure_customMethod · 0.95
configure_handlerMethod · 0.45

Calls 3

importerMethod · 0.80
splitMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected