Commit 55391639 authored by Bryton Lacquement's avatar Bryton Lacquement 🚪

trace: add comments about tasks to do

/cc @jm
parent 1b97b2ea
...@@ -7,6 +7,7 @@ from lib2to3.pytree import Node ...@@ -7,6 +7,7 @@ from lib2to3.pytree import Node
from . import BaseDynamicTraceFix from . import BaseDynamicTraceFix
from my2to3.util import parse_type from my2to3.util import parse_type
# TODO: /=
class FixDivisionTrace(BaseDynamicTraceFix): class FixDivisionTrace(BaseDynamicTraceFix):
"""Rewrites a / b into division_traced(..., a, b) """Rewrites a / b into division_traced(..., a, b)
......
...@@ -28,6 +28,8 @@ except Exception as e: ...@@ -28,6 +28,8 @@ except Exception as e:
except Exception as e: except Exception as e:
print(e) print(e)
raise raise
TODO: this does not cover all cases
""" """
basename = "nested_except" basename = "nested_except"
traced_information = "lineno_parent", "lineno_child" traced_information = "lineno_parent", "lineno_child"
......
...@@ -6,6 +6,7 @@ from lib2to3.refactor import get_fixers_from_package, RefactoringTool ...@@ -6,6 +6,7 @@ from lib2to3.refactor import get_fixers_from_package, RefactoringTool
database = "my2to3_traces.db" database = "my2to3_traces.db"
@contextmanager @contextmanager
def connection(): def connection():
# XXX: do not reopen all the time
conn = sqlite3.connect(database) conn = sqlite3.connect(database)
try: try:
with conn: with conn:
...@@ -19,6 +20,7 @@ tracing_functions = [] ...@@ -19,6 +20,7 @@ tracing_functions = []
def create_table(table, *columns): def create_table(table, *columns):
with connection() as conn: with connection() as conn:
v = ', '.join(columns) v = ', '.join(columns)
# BUG: not unique if there are NULL values
conn.execute( conn.execute(
"CREATE TABLE IF NOT EXISTS %s (%s, UNIQUE (%s))" % (table, v, v) "CREATE TABLE IF NOT EXISTS %s (%s, UNIQUE (%s))" % (table, v, v)
) )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment