# -*- coding: utf-8 -*- from importlib import import_module from logging.config import BaseConfigurator c1 = BaseConfigurator({}) print("c1 >> ", c1.importer) b1 = c1.importer('pickle') print("b1 >> ", b1) class CustomConfigurator(BaseConfigurator): importer = import_module c3 = CustomConfigurator({}) print("c3 >> ", c3.importer) b3 = c3.importer('pickle') print("b3 >> ", b3) ## OUTPUT ## ('c1 >> ', ) ## ('b1 >> ', ) ## ('c3 >> ', >) ## Traceback (most recent call last): ## File "test_logging.py", line 18, in ## b3 = c3.importer('pickle') ## File "/home/alex/.pythonbrew/pythons/Python-2.7.1/lib/python2.7/importlib/__init__.py", line 28, in import_module ## if name.startswith('.'): ## AttributeError: 'CustomConfigurator' object has no attribute 'startswith'