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
556b43d9
Commit
556b43d9
authored
Oct 05, 2007
by
Raymond Hettinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restore BEGIN/END THREADS macros which were squashed in the previous checkin
parent
44f326ef
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
5 deletions
+21
-5
Modules/_collectionsmodule.c
Modules/_collectionsmodule.c
+21
-5
No files found.
Modules/_collectionsmodule.c
View file @
556b43d9
...
@@ -631,7 +631,7 @@ PyDoc_STRVAR(reduce_doc, "Return state information for pickling.");
...
@@ -631,7 +631,7 @@ PyDoc_STRVAR(reduce_doc, "Return state information for pickling.");
static
PyObject
*
static
PyObject
*
deque_repr
(
PyObject
*
deque
)
deque_repr
(
PyObject
*
deque
)
{
{
PyObject
*
aslist
,
*
result
,
*
fmt
;
/*, *limit; */
PyObject
*
aslist
,
*
result
,
*
fmt
;
int
i
;
int
i
;
i
=
Py_ReprEnter
(
deque
);
i
=
Py_ReprEnter
(
deque
);
...
@@ -656,7 +656,7 @@ deque_repr(PyObject *deque)
...
@@ -656,7 +656,7 @@ deque_repr(PyObject *deque)
Py_ReprLeave
(
deque
);
Py_ReprLeave
(
deque
);
return
NULL
;
return
NULL
;
}
}
result
=
PyString_Format
(
fmt
,
aslist
);
result
=
PyString_Format
(
fmt
,
aslist
);
Py_DECREF
(
fmt
);
Py_DECREF
(
fmt
);
Py_DECREF
(
aslist
);
Py_DECREF
(
aslist
);
Py_ReprLeave
(
deque
);
Py_ReprLeave
(
deque
);
...
@@ -675,7 +675,9 @@ deque_tp_print(PyObject *deque, FILE *fp, int flags)
...
@@ -675,7 +675,9 @@ deque_tp_print(PyObject *deque, FILE *fp, int flags)
if
(
i
!=
0
)
{
if
(
i
!=
0
)
{
if
(
i
<
0
)
if
(
i
<
0
)
return
i
;
return
i
;
Py_BEGIN_ALLOW_THREADS
fputs
(
"[...]"
,
fp
);
fputs
(
"[...]"
,
fp
);
Py_END_ALLOW_THREADS
return
0
;
return
0
;
}
}
...
@@ -683,9 +685,13 @@ deque_tp_print(PyObject *deque, FILE *fp, int flags)
...
@@ -683,9 +685,13 @@ deque_tp_print(PyObject *deque, FILE *fp, int flags)
if
(
it
==
NULL
)
if
(
it
==
NULL
)
return
-
1
;
return
-
1
;
Py_BEGIN_ALLOW_THREADS
fputs
(
"deque(["
,
fp
);
fputs
(
"deque(["
,
fp
);
Py_END_ALLOW_THREADS
while
((
item
=
PyIter_Next
(
it
))
!=
NULL
)
{
while
((
item
=
PyIter_Next
(
it
))
!=
NULL
)
{
Py_BEGIN_ALLOW_THREADS
fputs
(
emit
,
fp
);
fputs
(
emit
,
fp
);
Py_END_ALLOW_THREADS
emit
=
separator
;
emit
=
separator
;
if
(
PyObject_Print
(
item
,
fp
,
0
)
!=
0
)
{
if
(
PyObject_Print
(
item
,
fp
,
0
)
!=
0
)
{
Py_DECREF
(
item
);
Py_DECREF
(
item
);
...
@@ -700,10 +706,12 @@ deque_tp_print(PyObject *deque, FILE *fp, int flags)
...
@@ -700,10 +706,12 @@ deque_tp_print(PyObject *deque, FILE *fp, int flags)
if
(
PyErr_Occurred
())
if
(
PyErr_Occurred
())
return
-
1
;
return
-
1
;
Py_BEGIN_ALLOW_THREADS
if
(((
dequeobject
*
)
deque
)
->
maxlen
==
-
1
)
if
(((
dequeobject
*
)
deque
)
->
maxlen
==
-
1
)
fputs
(
"])"
,
fp
);
fputs
(
"])"
,
fp
);
else
else
fprintf
(
fp
,
"], maxlen=%d)"
,
((
dequeobject
*
)
deque
)
->
maxlen
);
fprintf
(
fp
,
"], maxlen=%d)"
,
((
dequeobject
*
)
deque
)
->
maxlen
);
Py_END_ALLOW_THREADS
return
0
;
return
0
;
}
}
...
@@ -1223,15 +1231,23 @@ static int
...
@@ -1223,15 +1231,23 @@ static int
defdict_print
(
defdictobject
*
dd
,
FILE
*
fp
,
int
flags
)
defdict_print
(
defdictobject
*
dd
,
FILE
*
fp
,
int
flags
)
{
{
int
sts
;
int
sts
;
Py_BEGIN_ALLOW_THREADS
fprintf
(
fp
,
"defaultdict("
);
fprintf
(
fp
,
"defaultdict("
);
if
(
dd
->
default_factory
==
NULL
)
Py_END_ALLOW_THREADS
if
(
dd
->
default_factory
==
NULL
)
{
Py_BEGIN_ALLOW_THREADS
fprintf
(
fp
,
"None"
);
fprintf
(
fp
,
"None"
);
else
{
Py_END_ALLOW_THREADS
}
else
{
PyObject_Print
(
dd
->
default_factory
,
fp
,
0
);
PyObject_Print
(
dd
->
default_factory
,
fp
,
0
);
}
}
Py_BEGIN_ALLOW_THREADS
fprintf
(
fp
,
", "
);
fprintf
(
fp
,
", "
);
Py_END_ALLOW_THREADS
sts
=
PyDict_Type
.
tp_print
((
PyObject
*
)
dd
,
fp
,
0
);
sts
=
PyDict_Type
.
tp_print
((
PyObject
*
)
dd
,
fp
,
0
);
Py_BEGIN_ALLOW_THREADS
fprintf
(
fp
,
")"
);
fprintf
(
fp
,
")"
);
Py_END_ALLOW_THREADS
return
sts
;
return
sts
;
}
}
...
...
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