'pyc' variable has been set to None before logger.warn uses it