mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-03-15 07:24:09 +00:00
simplify if statements
This commit is contained in:
@@ -40,9 +40,8 @@ class DeadlockHandler:
|
||||
if exc_type == psycopg2.errors.DeadlockDetected: # pylint: disable=E1101
|
||||
self.handler()
|
||||
return True
|
||||
else:
|
||||
if exc_type == psycopg2.extensions.TransactionRollbackError:
|
||||
if exc_value.pgcode == '40P01':
|
||||
elif exc_type == psycopg2.extensions.TransactionRollbackError \
|
||||
and exc_value.pgcode == '40P01':
|
||||
self.handler()
|
||||
return True
|
||||
|
||||
|
||||
@@ -130,8 +130,7 @@ def import_osm_data(osm_file, options, drop=False, ignore_errors=False):
|
||||
if drop:
|
||||
conn.drop_table('planet_osm_nodes')
|
||||
|
||||
if drop:
|
||||
if options['flatnode_file']:
|
||||
if drop and options['flatnode_file']:
|
||||
Path(options['flatnode_file']).unlink()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user