Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
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
Boxiang Sun
Pyston
Commits
d43ea30f
Commit
d43ea30f
authored
Oct 06, 2015
by
Kevin Modzelewski
Committed by
Kevin Modzelewski
Jun 16, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dict ctor should not propagate certain exceptions
parent
616dd7bf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
src/runtime/dict.cpp
src/runtime/dict.cpp
+1
-1
test/tests/dict.py
test/tests/dict.py
+13
-0
No files found.
src/runtime/dict.cpp
View file @
d43ea30f
...
...
@@ -800,7 +800,7 @@ Box* dictUpdate(BoxedDict* self, BoxedTuple* args, BoxedDict* kwargs) {
if
(
args
->
size
())
{
Box
*
arg
=
args
->
elts
[
0
];
static
BoxedString
*
keys_str
=
getStaticString
(
"keys"
);
if
(
autoXDecref
(
getattrInternal
<
ExceptionStyle
::
CXX
>
(
arg
,
keys_str
)
))
{
if
(
PyObject_HasAttr
(
arg
,
keys_str
))
{
dictMerge
(
self
,
arg
);
}
else
{
dictMergeFromSeq2
(
self
,
arg
);
...
...
test/tests/dict.py
View file @
d43ea30f
...
...
@@ -240,3 +240,16 @@ print d
# Remove an item using a different key:
d
=
{
1
:
1
}
d
.
pop
(
1L
)
# dict() will try to access the "keys" attribute, but it should swallow all exceptions
class
MyObj
(
object
):
def
__iter__
(
self
):
print
"iter!"
return
[(
1
,
2
)].
__iter__
()
def
__getattr__
(
self
,
attr
):
print
"getattr"
,
attr
1
/
0
print
dict
(
MyObj
())
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