Skip to content

Commit

Permalink
dispose only for exception
Browse files Browse the repository at this point in the history
  • Loading branch information
bernt-matthias committed Jul 15, 2020
1 parent 7e41e85 commit e481582
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions sqlalchemy_utils/functions/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,9 +476,8 @@ def sqlite_file_exists(database):
ret = bool(get_scalar_result(engine, text))
break
except (ProgrammingError, OperationalError):
pass
finally:
engine.dispose()
engine = None

elif dialect_name == 'mysql':
engine = sa.create_engine(url)
Expand Down

0 comments on commit e481582

Please sign in to comment.