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
Emmy Vouriot
my2to3
Commits
742b6566
Commit
742b6566
authored
Jun 17, 2020
by
Bryton Lacquement
🚪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix_{traced,}division: modify trace format
':' is too common; it can be used in the filename.
parent
1d87f427
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
3 deletions
+2
-3
my2to3/fixes/fix_division.py
my2to3/fixes/fix_division.py
+1
-2
my2to3/fixes/fix_trace_division.py
my2to3/fixes/fix_trace_division.py
+1
-1
No files found.
my2to3/fixes/fix_division.py
View file @
742b6566
...
...
@@ -9,7 +9,7 @@ import re
from
my2to3.util
import
add_future
trace_file_match
=
re
.
compile
(
r"^(.*)
:(.*):
(.*) <type '(.*)'> / <type '(.*)'>$"
).
match
trace_file_match
=
re
.
compile
(
r"^(.*)
\
|(.*)
\|
(.*) <type '(.*)'> / <type '(.*)'>$"
).
match
def
parse_trace_data
(
filepath
):
...
...
@@ -70,7 +70,6 @@ class FixDivision(lib2to3.fixer_base.BaseFix):
def
transform
(
self
,
node
,
results
):
lineno
=
node
.
get_lineno
()
id_
=
int
(
node
.
children
[
1
].
children
[
1
].
children
[
0
].
value
)
data
=
self
.
traces
[
self
.
absolute_filename
][
lineno
][
id_
]
if
not
data
:
return
...
...
my2to3/fixes/fix_trace_division.py
View file @
742b6566
...
...
@@ -16,7 +16,7 @@ class FixTraceDivision(lib2to3.fixer_base.BaseFix):
def division_traced(id, dividend, divisor):
import inspect
previous_frame = inspect.currentframe().f_back
print ("{}
:{}:
{} {} / {}".format(
print ("{}
|{}|
{} {} / {}".format(
previous_frame.f_code.co_filename,
previous_frame.f_lineno,
id,
...
...
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