Skip to content

Commit 17f093d

Browse files
authored
Remove unnecessary use of python 2 compat type (dbcli#900)
Since python 2 compat has been removed and sqlparse 0.4 also doesn't ship with the compat module anymore, there is no reason to use the text_type alias for str/unicode.
1 parent f3442f4 commit 17f093d

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

changelog.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,17 @@ Features:
66

77
* Add an option `--init-command` to execute SQL after connecting (Thanks: [KITAGAWA Yasutaka]).
88

9+
Bug Fixes:
10+
----------
11+
* Fixed compatibility with sqlparse 0.4 (Thanks: [mtorromeo]).
12+
913
1.22.2
1014
======
1115

1216
Bug Fixes:
1317
----------
1418

15-
* Make the `pwd` module optional.
19+
* Make the `pwd` module optional.
1620

1721
1.22.1
1822
======
@@ -785,3 +789,4 @@ Bug Fixes:
785789
[Georgy Frolov]: https://github.com/pasenor
786790
[Zach DeCook]: https://zachdecook.com
787791
[laixintao]: https://github.com/laixintao
792+
[mtorromeo]: https://github.com/mtorromeo

mycli/AUTHORS

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ Contributors:
7575
* Zach DeCook
7676
* kevinhwang91
7777
* KITAGAWA Yasutaka
78+
* Massimiliano Torromeo
7879

7980
Creator:
8081
--------

mycli/packages/completion_engine.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import sys
33
import sqlparse
44
from sqlparse.sql import Comparison, Identifier, Where
5-
from sqlparse.compat import text_type
65
from .parseutils import last_word, extract_tables, find_prev_keyword
76
from .special import parse_special_command
87

@@ -55,7 +54,7 @@ def suggest_type(full_text, text_before_cursor):
5554
stmt_start, stmt_end = 0, 0
5655

5756
for statement in parsed:
58-
stmt_len = len(text_type(statement))
57+
stmt_len = len(str(statement))
5958
stmt_start, stmt_end = stmt_end, stmt_end + stmt_len
6059

6160
if stmt_end >= current_pos:

0 commit comments

Comments
 (0)