Skip to content

Commit beb8949

Browse files
committed
Version bump v10.2.2-beta.7
+ Fix issue compiling xElementTree in Python 2.6 + Fix problem with SQLite transactions and symbol.db + PHP function signature with return type not lowercased + Python function signatures fixed + Python 2-3 translation improved + Passing many more tests: Python 2.7: (4 skips, 60 failures) Python 3.6: (4 skips, 82 failures, 1 error)
1 parent feaff22 commit beb8949

9 files changed

Lines changed: 200 additions & 120 deletions

File tree

codeintel/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '10.2.2-beta.6'
1+
__version__ = '10.2.2-beta.7'

codeintel/codeintel2/database/langlib.py

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -963,20 +963,20 @@ def _get_symbols_db_conn(self):
963963
except:
964964
log.exception("Unable to create/open symbols.db")
965965
return None
966-
cursor = conn.cursor()
967966
if not exists:
968-
cursor.execute("""
969-
CREATE TABLE symbols ('symbol_id' INTEGER PRIMARY KEY,
970-
'symbol' TEXT NOT NULL,
971-
'type' TEXT NOT NULL,
972-
'filepath' TEXT NOT NULL,
973-
'lineno' INTEGER NOT NULL,
974-
'lang' TEXT NOT NULL,
975-
'parent' TEXT)
976-
""")
977-
cursor.execute("CREATE UNIQUE INDEX 'symbol_id' on symbols (symbol_id ASC)")
978967
try:
979-
cursor.execute("COMMIT")
968+
with conn:
969+
cursor = conn.cursor()
970+
cursor.execute("""
971+
CREATE TABLE symbols ('symbol_id' INTEGER PRIMARY KEY,
972+
'symbol' TEXT NOT NULL,
973+
'type' TEXT NOT NULL,
974+
'filepath' TEXT NOT NULL,
975+
'lineno' INTEGER NOT NULL,
976+
'lang' TEXT NOT NULL,
977+
'parent' TEXT)
978+
""")
979+
cursor.execute("CREATE UNIQUE INDEX 'symbol_id' on symbols (symbol_id ASC)")
980980
except apsw.SQLError:
981981
log.warn("Unable to create symbols.db: possibly exists?")
982982
return None
@@ -995,9 +995,14 @@ def _update_symbols_db(self, conn, action, blob):
995995
"""
996996
if not conn:
997997
return
998-
998+
try:
999+
with conn:
1000+
self._update_symbols_db_transaction(conn, action, blob)
1001+
except apsw.SQLError:
1002+
log.error("Unable to save to symbols db.")
1003+
1004+
def _update_symbols_db_transaction(self, conn, action, blob):
9991005
cursor = conn.cursor()
1000-
cursor.execute("BEGIN")
10011006

10021007
# Delete any symbols in the blob's file.
10031008
if action == "update" or action == "remove":
@@ -1028,11 +1033,6 @@ def insert_all(elem, parent=None):
10281033
insert_all(n, valid and elem)
10291034

10301035
insert_all(blob)
1031-
1032-
try:
1033-
cursor.execute("commit")
1034-
except apsw.SQLError:
1035-
log.error("Unable to save to symbols db.")
10361036

10371037
def _close_symbols_db_conn(self, conn):
10381038
"""

codeintel/codeintel2/lang_php.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1558,7 +1558,7 @@ def __init__(self, funcname, phpArgs, lineno, depth=0,
15581558
if docinfo[2]:
15591559
self.returnType = docinfo[2][0]
15601560
if self.returnType:
1561-
self.signature = '%s %s' % (self.returnType.lower(), self.signature, )
1561+
self.signature = '%s %s' % (self.returnType, self.signature, )
15621562
self.signature += "("
15631563
if self.args:
15641564
self.signature += ", ".join([x.signature for x in self.args])

0 commit comments

Comments
 (0)