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
Bryton Lacquement
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
Show 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
...
@@ -9,7 +9,7 @@ import re
from
my2to3.util
import
add_future
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
):
def
parse_trace_data
(
filepath
):
...
@@ -70,7 +70,6 @@ class FixDivision(lib2to3.fixer_base.BaseFix):
...
@@ -70,7 +70,6 @@ class FixDivision(lib2to3.fixer_base.BaseFix):
def
transform
(
self
,
node
,
results
):
def
transform
(
self
,
node
,
results
):
lineno
=
node
.
get_lineno
()
lineno
=
node
.
get_lineno
()
id_
=
int
(
node
.
children
[
1
].
children
[
1
].
children
[
0
].
value
)
id_
=
int
(
node
.
children
[
1
].
children
[
1
].
children
[
0
].
value
)
data
=
self
.
traces
[
self
.
absolute_filename
][
lineno
][
id_
]
data
=
self
.
traces
[
self
.
absolute_filename
][
lineno
][
id_
]
if
not
data
:
if
not
data
:
return
return
...
...
my2to3/fixes/fix_trace_division.py
View file @
742b6566
...
@@ -16,7 +16,7 @@ class FixTraceDivision(lib2to3.fixer_base.BaseFix):
...
@@ -16,7 +16,7 @@ class FixTraceDivision(lib2to3.fixer_base.BaseFix):
def division_traced(id, dividend, divisor):
def division_traced(id, dividend, divisor):
import inspect
import inspect
previous_frame = inspect.currentframe().f_back
previous_frame = inspect.currentframe().f_back
print ("{}
:{}:
{} {} / {}".format(
print ("{}
|{}|
{} {} / {}".format(
previous_frame.f_code.co_filename,
previous_frame.f_code.co_filename,
previous_frame.f_lineno,
previous_frame.f_lineno,
id,
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