Fixed cStringIO and StringIO module compatibility in python
parent
f682f06c94
commit
8e4e1640e7
|
@ -45,12 +45,12 @@ import codecs
|
|||
# SQLite3 needs all string as UTF-8
|
||||
# We need to make string for Python2/3 compatible
|
||||
if sys.version_info < (3,):
|
||||
from io import StringIO
|
||||
from StringIO import StringIO
|
||||
|
||||
def u(x):
|
||||
return codecs.unicode_escape_decode(x)[0]
|
||||
else:
|
||||
from cStringIO import StringIO
|
||||
from io import StringIO
|
||||
|
||||
def u(x):
|
||||
return x
|
||||
|
|
|
@ -32,7 +32,7 @@ from pgadmin.model import Process, db
|
|||
if sys.version_info < (3,):
|
||||
from StringIO import StringIO
|
||||
else:
|
||||
from cStringIO import StringIO
|
||||
from io import StringIO
|
||||
|
||||
|
||||
def get_current_time(format='%Y-%m-%d %H:%M:%S.%f %z'):
|
||||
|
|
Loading…
Reference in New Issue