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
31ba8480
Commit
31ba8480
authored
Sep 30, 2007
by
Brett Cannon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix error introduced by r58288; if a tuple is length 0 return its repr and
don't worry about any self-referring tuples.
parent
0b14f243
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
Objects/tupleobject.c
Objects/tupleobject.c
+4
-4
No files found.
Objects/tupleobject.c
View file @
31ba8480
...
@@ -216,6 +216,10 @@ tuplerepr(PyTupleObject *v)
...
@@ -216,6 +216,10 @@ tuplerepr(PyTupleObject *v)
PyObject
*
s
,
*
temp
;
PyObject
*
s
,
*
temp
;
PyObject
*
pieces
,
*
result
=
NULL
;
PyObject
*
pieces
,
*
result
=
NULL
;
n
=
Py_Size
(
v
);
if
(
n
==
0
)
return
PyString_FromString
(
"()"
);
/* While not mutable, it is still possible to end up with a cycle in a
/* While not mutable, it is still possible to end up with a cycle in a
tuple through an object that stores itself within a tuple (and thus
tuple through an object that stores itself within a tuple (and thus
infinitely asks for the repr of itself). This should only be
infinitely asks for the repr of itself). This should only be
...
@@ -225,10 +229,6 @@ tuplerepr(PyTupleObject *v)
...
@@ -225,10 +229,6 @@ tuplerepr(PyTupleObject *v)
return
i
>
0
?
PyString_FromString
(
"(...)"
)
:
NULL
;
return
i
>
0
?
PyString_FromString
(
"(...)"
)
:
NULL
;
}
}
n
=
Py_Size
(
v
);
if
(
n
==
0
)
return
PyString_FromString
(
"()"
);
pieces
=
PyTuple_New
(
n
);
pieces
=
PyTuple_New
(
n
);
if
(
pieces
==
NULL
)
if
(
pieces
==
NULL
)
return
NULL
;
return
NULL
;
...
...
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