Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
9f26fc6e
Commit
9f26fc6e
authored
Mar 10, 2014
by
Victor Stinner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tracemalloc: filter_traces() raises a TypeError if filters is not an iterable
parent
bbce3580
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
Lib/test/test_tracemalloc.py
Lib/test/test_tracemalloc.py
+2
-0
Lib/tracemalloc.py
Lib/tracemalloc.py
+4
-1
No files found.
Lib/test/test_tracemalloc.py
View file @
9f26fc6e
...
...
@@ -346,6 +346,8 @@ class TestSnapshot(unittest.TestCase):
self
.
assertIsNot
(
snapshot5
.
traces
,
snapshot
.
traces
)
self
.
assertEqual
(
snapshot5
.
traces
,
snapshot
.
traces
)
self
.
assertRaises
(
TypeError
,
snapshot
.
filter_traces
,
filter1
)
def
test_snapshot_group_by_line
(
self
):
snapshot
,
snapshot2
=
create_snapshots
()
tb_0
=
traceback_lineno
(
'<unknown>'
,
0
)
...
...
Lib/tracemalloc.py
View file @
9f26fc6e
from
collections
import
Sequence
from
collections
import
Sequence
,
Iterable
from
functools
import
total_ordering
import
fnmatch
import
linecache
...
...
@@ -382,6 +382,9 @@ class Snapshot:
is a list of Filter instances. If filters is an empty list, return a
new Snapshot instance with a copy of the traces.
"""
if
not
isinstance
(
filters
,
Iterable
):
raise
TypeError
(
"filters must be a list of filters, not %s"
%
type
(
filters
).
__name__
)
if
filters
:
include_filters
=
[]
exclude_filters
=
[]
...
...
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