Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
my2to3
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xavier Thompson
my2to3
Commits
55391639
Commit
55391639
authored
Aug 31, 2020
by
Bryton Lacquement
🚪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
trace: add comments about tasks to do
/cc
@jm
parent
1b97b2ea
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
0 deletions
+5
-0
my2to3/fixes/fix_division_trace.py
my2to3/fixes/fix_division_trace.py
+1
-0
my2to3/fixes/fix_nested_except_trace.py
my2to3/fixes/fix_nested_except_trace.py
+2
-0
my2to3/trace.py
my2to3/trace.py
+2
-0
No files found.
my2to3/fixes/fix_division_trace.py
View file @
55391639
...
...
@@ -7,6 +7,7 @@ from lib2to3.pytree import Node
from
.
import
BaseDynamicTraceFix
from
my2to3.util
import
parse_type
# TODO: /=
class
FixDivisionTrace
(
BaseDynamicTraceFix
):
"""Rewrites a / b into division_traced(..., a, b)
...
...
my2to3/fixes/fix_nested_except_trace.py
View file @
55391639
...
...
@@ -28,6 +28,8 @@ except Exception as e:
except Exception as e:
print(e)
raise
TODO: this does not cover all cases
"""
basename
=
"nested_except"
traced_information
=
"lineno_parent"
,
"lineno_child"
...
...
my2to3/trace.py
View file @
55391639
...
...
@@ -6,6 +6,7 @@ from lib2to3.refactor import get_fixers_from_package, RefactoringTool
database
=
"my2to3_traces.db"
@
contextmanager
def
connection
():
# XXX: do not reopen all the time
conn
=
sqlite3
.
connect
(
database
)
try
:
with
conn
:
...
...
@@ -19,6 +20,7 @@ tracing_functions = []
def
create_table
(
table
,
*
columns
):
with
connection
()
as
conn
:
v
=
', '
.
join
(
columns
)
# BUG: not unique if there are NULL values
conn
.
execute
(
"CREATE TABLE IF NOT EXISTS %s (%s, UNIQUE (%s))"
%
(
table
,
v
,
v
)
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment