Permalink
Browse files

Fix gunicorn ssl crash on Python < 2.7.9

Fixes #2273.
  • Loading branch information...
seanh committed Jun 3, 2015
1 parent 06278fb commit 31bfce2512e7f96dc94c009017b596d838ef0bc0
Showing with 7 additions and 4 deletions.
  1. +7 −4 gunicorn.conf.py
View
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
import os
import sys
import urlparse
# Smart detect heroku stack and assume a trusted proxy.
@@ -13,10 +14,12 @@
def post_fork(_server, _worker):
# Support back-ported SSL changes on Debian / Ubuntu
import _ssl
import gevent.hub
if not hasattr(_ssl, '_sslwrap'):
gevent.hub.PYGTE279 = True
major, minor, micro, _, _ = sys.version_info
if major == 2 and minor == 7 and micro >= 9:
import _ssl
import gevent.hub
if not hasattr(_ssl, '_sslwrap'):
gevent.hub.PYGTE279 = True
try:
import psycogreen.gevent

0 comments on commit 31bfce2

Please sign in to comment.