mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-16 15:47:58 +00:00
remove stale code for python2
This commit is contained in:
@@ -5,7 +5,6 @@ import psycopg2
|
|||||||
import psycopg2.extras
|
import psycopg2.extras
|
||||||
import subprocess
|
import subprocess
|
||||||
import tempfile
|
import tempfile
|
||||||
from sys import version_info as python_version
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@@ -172,10 +171,7 @@ class NominatimEnvironment(object):
|
|||||||
cur.execute('CREATE DATABASE %s TEMPLATE = %s' % (self.test_db, self.template_db))
|
cur.execute('CREATE DATABASE %s TEMPLATE = %s' % (self.test_db, self.template_db))
|
||||||
conn.close()
|
conn.close()
|
||||||
context.db = self.connect_database(self.test_db)
|
context.db = self.connect_database(self.test_db)
|
||||||
if python_version[0] < 3:
|
psycopg2.extras.register_hstore(context.db, globally=False)
|
||||||
psycopg2.extras.register_hstore(context.db, globally=False, unicode=True)
|
|
||||||
else:
|
|
||||||
psycopg2.extras.register_hstore(context.db, globally=False)
|
|
||||||
|
|
||||||
def teardown_db(self, context):
|
def teardown_db(self, context):
|
||||||
if 'db' in context:
|
if 'db' in context:
|
||||||
|
|||||||
Reference in New Issue
Block a user