mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fixed cStringIO and StringIO module compatibility in python
This commit is contained in:
parent
f682f06c94
commit
8e4e1640e7
@ -45,12 +45,12 @@ import codecs
|
|||||||
# SQLite3 needs all string as UTF-8
|
# SQLite3 needs all string as UTF-8
|
||||||
# We need to make string for Python2/3 compatible
|
# We need to make string for Python2/3 compatible
|
||||||
if sys.version_info < (3,):
|
if sys.version_info < (3,):
|
||||||
from io import StringIO
|
from StringIO import StringIO
|
||||||
|
|
||||||
def u(x):
|
def u(x):
|
||||||
return codecs.unicode_escape_decode(x)[0]
|
return codecs.unicode_escape_decode(x)[0]
|
||||||
else:
|
else:
|
||||||
from cStringIO import StringIO
|
from io import StringIO
|
||||||
|
|
||||||
def u(x):
|
def u(x):
|
||||||
return x
|
return x
|
||||||
|
@ -32,7 +32,7 @@ from pgadmin.model import Process, db
|
|||||||
if sys.version_info < (3,):
|
if sys.version_info < (3,):
|
||||||
from StringIO import StringIO
|
from StringIO import StringIO
|
||||||
else:
|
else:
|
||||||
from cStringIO import StringIO
|
from io import StringIO
|
||||||
|
|
||||||
|
|
||||||
def get_current_time(format='%Y-%m-%d %H:%M:%S.%f %z'):
|
def get_current_time(format='%Y-%m-%d %H:%M:%S.%f %z'):
|
||||||
|
Loading…
Reference in New Issue
Block a user