mirror of
https://github.com/jazzband/django-ddp.git
synced 2026-03-16 22:40:24 +00:00
Fix order of psycopg2cffi.compat.register() call and psycogreen.gevent.patch_psycopg() call, demote threading module exception to warning.
This commit is contained in:
parent
120d5327fd
commit
5ec0c392d3
1 changed files with 5 additions and 4 deletions
|
|
@ -25,12 +25,10 @@ def greenify():
|
|||
|
||||
from gevent.monkey import patch_all, saved
|
||||
if ('threading' in sys.modules) and ('threading' not in saved):
|
||||
raise Exception('threading module loaded before patching!')
|
||||
import warnings
|
||||
warnings.warn('threading module loaded before patching!')
|
||||
patch_all()
|
||||
|
||||
from psycogreen.gevent import patch_psycopg
|
||||
patch_psycopg()
|
||||
|
||||
try:
|
||||
# Use psycopg2 by default
|
||||
import psycopg2
|
||||
|
|
@ -40,6 +38,9 @@ def greenify():
|
|||
from psycopg2cffi import compat
|
||||
compat.register()
|
||||
|
||||
from psycogreen.gevent import patch_psycopg
|
||||
patch_psycopg()
|
||||
|
||||
|
||||
class AlreadyRegistered(Exception):
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue