1
0
Fork 0

fix IPython magic (#1253)

This commit is contained in:
Georgy Frolov 2021-03-12 21:16:14 +03:00 committed by GitHub
parent e009995e9f
commit a017fa96bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -14,6 +14,7 @@ Bug fixes:
* Fix issue where `syntax_style` config value would not have any effect. (#1212)
* Fix crash because of not found `InputMode.REPLACE_SINGLE` with prompt-toolkit < 3.0.6
* Fix comments being lost in config when saving a named query. (#1240)
* Fix IPython magic for ipython-sql >= 0.4.0
3.1.0
=====

View File

@ -25,7 +25,11 @@ def pgcli_line_magic(line):
if hasattr(sql.connection.Connection, "get"):
conn = sql.connection.Connection.get(parsed["connection"])
else:
conn = sql.connection.Connection.set(parsed["connection"])
try:
conn = sql.connection.Connection.set(parsed["connection"])
# a new positional argument was added to Connection.set in version 0.4.0 of ipython-sql
except TypeError:
conn = sql.connection.Connection.set(parsed["connection"], False)
try:
# A corresponding pgcli object already exists