A
A
Alexander2017-01-13 16:41:37
Python
Alexander, 2017-01-13 16:41:37

What does PyCharm expect from me?

Good evening,
People, please tell me what PyCharm wants from me?
There is a piece of code for creating a logger for recording events in the Windows EventLog:

if name is 'nt':
    try:
        from logging.handlers import NTEventLogHandler
        win_log_handler = NTEventLogHandler(appname='update_aduser', logtype='Application')
        win_log_handler.setFormatter(log_formatter)
        win_logger = logging.getLogger('win_logger')
        win_logger.addHandler(win_log_handler)
    except ImportError:
        write_log(file_logger, logging.WARNING, "cannot import 'NTEventLogHandler' module")

PyCharm underlines the line and writes this warning:
682747f888d74a529d5ca6b9589dccbd.PNG

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
tsarevfs, 2017-01-13
@asand3r

stackoverflow.com/a/35901372/1762922

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question