Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

serve.py: Define logger if undefined #28246

Merged
merged 1 commit into from Apr 6, 2021
Merged

serve.py: Define logger if undefined #28246

merged 1 commit into from Apr 6, 2021

Conversation

arenevier
Copy link
Contributor

create_daemon is sometimes called in a new python instance, in which
case it looses the reference to global variable logger. When it happens,
we redefine logger with at default value.

Fixes #28245

@@ -514,6 +514,12 @@ def start(self, init_func, host, port, paths, routes, bind_address, config, **kw

def create_daemon(self, init_func, host, port, paths, routes, bind_address,
config, **kwargs):

global logger
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need to call set_logger(config.logger). Maybe we could just have an ensure_logger(config) function.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like you forgot to update the patch?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed. I have pushed the correct patch now.

create_daemon is sometimes called in a new python instance, in which
case it looses the reference to global variable logger. When it happens,
we redefine logger with at default value.

Fixes #28245
@jgraham jgraham merged commit b578f56 into web-platform-tests:master Apr 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NameError: name 'logger' is not defined when ./wpt run startup fails
4 participants