Import _strptime early to avoid errors on import in threads.

This commit is contained in:
Neil Williams
2012-04-10 10:49:20 -07:00
committed by Logan Hanks
parent 3d87a7956a
commit b0ad6eadf0

View File

@@ -24,6 +24,13 @@
This file loads the finished app from r2.config.middleware.
"""
# _strptime is imported with PyImport_ImportModuleNoBlock which can fail
# miserably when multiple threads try to import it simultaneously.
# import this here to get it over with
# see "Non Blocking Module Imports" in:
# http://code.google.com/p/modwsgi/wiki/ApplicationIssues
import _strptime
# defer the (hefty) import until it's actually needed. this allows
# modules below r2 to be imported before cython files are built, also
# provides a hefty speed boost to said imports when they don't need