mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-26 07:19:25 -05:00
Import _strptime early to avoid errors on import in threads.
This commit is contained in:
committed by
Logan Hanks
parent
3d87a7956a
commit
b0ad6eadf0
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user