Skip to content
New issue

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

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

Already on GitHub? # to your account

Moved up assignment so __profiler_base is always defined. #677

Merged
merged 1 commit into from
Aug 31, 2023

Conversation

emeryberger
Copy link
Member

Fixes Scalene behavior for the following test case:

import os
from django.conf import settings
from django.core.wsgi import get_wsgi_application
from django.http import HttpResponse
from django.urls import path

# Settings
settings.configure(
    DEBUG=True,
    ROOT_URLCONF=__name__,
    SECRET_KEY=os.urandom(32),
    ALLOWED_HOSTS=['*'],
    WSGI_APPLICATION='__main__.application',
)

# Simple view
def hello_world(request):
    return HttpResponse("Hello, Django!")

# URL configuration
urlpatterns = [
    path('', hello_world),
]

application = get_wsgi_application()

if __name__ == "__main__":
    from django.core.management import execute_from_command_line
    execute_from_command_line([__file__, 'runserver'])

@emeryberger emeryberger merged commit f1c843d into master Aug 31, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant