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
8283a622
Commit
8283a622
authored
Aug 03, 2011
by
Senthil Kumaran
Browse files
Options
Browse Files
Download
Plain Diff
merge heads
parents
8a984b58
83fad3e2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
7 deletions
+18
-7
Lib/http/client.py
Lib/http/client.py
+2
-2
Lib/test/test_posix.py
Lib/test/test_posix.py
+13
-4
Lib/test/test_support.py
Lib/test/test_support.py
+2
-0
Modules/posixmodule.c
Modules/posixmodule.c
+1
-1
No files found.
Lib/http/client.py
View file @
8283a622
...
...
@@ -777,8 +777,8 @@ class HTTPConnection:
for
d
in
data
:
self
.
sock
.
sendall
(
d
)
else
:
raise
TypeError
(
"data should be a bytes-like object
\
or an iterable, got %r
"
%
type
(
data
))
raise
TypeError
(
"data should be a bytes-like object
"
"or an iterable, got %r
"
%
type
(
data
))
def
_output
(
self
,
s
):
"""Add a line of output to the current request buffer.
...
...
Lib/test/test_posix.py
View file @
8283a622
...
...
@@ -832,7 +832,7 @@ class PosixTester(unittest.TestCase):
requires_sched_h
=
unittest
.
skipUnless
(
hasattr
(
posix
,
'sched_yield'
),
"don't have scheduling support"
)
requires_sched_affinity
=
unittest
.
skipUnless
(
hasattr
(
posix
,
'cpu_set'
),
"don
t'
have sched affinity support"
)
"don
't
have sched affinity support"
)
@
requires_sched_h
def
test_sched_yield
(
self
):
...
...
@@ -848,8 +848,10 @@ class PosixTester(unittest.TestCase):
self
.
assertIsInstance
(
lo
,
int
)
self
.
assertIsInstance
(
hi
,
int
)
self
.
assertGreaterEqual
(
hi
,
lo
)
self
.
assertRaises
(
OSError
,
posix
.
sched_get_priority_min
,
-
23
)
self
.
assertRaises
(
OSError
,
posix
.
sched_get_priority_max
,
-
23
)
# OSX evidently just returns 15 without checking the argument.
if
sys
.
platform
!=
"darwin"
:
self
.
assertRaises
(
OSError
,
posix
.
sched_get_priority_min
,
-
23
)
self
.
assertRaises
(
OSError
,
posix
.
sched_get_priority_max
,
-
23
)
@
unittest
.
skipUnless
(
hasattr
(
posix
,
'sched_setscheduler'
),
"can't change scheduler"
)
def
test_get_and_set_scheduler_and_param
(
self
):
...
...
@@ -888,7 +890,14 @@ class PosixTester(unittest.TestCase):
@
unittest
.
skipUnless
(
hasattr
(
posix
,
"sched_rr_get_interval"
),
"no function"
)
def
test_sched_rr_get_interval
(
self
):
interval
=
posix
.
sched_rr_get_interval
(
0
)
try
:
interval
=
posix
.
sched_rr_get_interval
(
0
)
except
OSError
as
e
:
# This likely means that sched_rr_get_interval is only valid for
# processes with the SCHED_RR scheduler in effect.
if
e
.
errno
!=
errno
.
EINVAL
:
raise
self
.
skipTest
(
"only works on SCHED_RR processes"
)
self
.
assertIsInstance
(
interval
,
float
)
# Reasonable constraints, I think.
self
.
assertGreaterEqual
(
interval
,
0.
)
...
...
Lib/test/test_support.py
View file @
8283a622
...
...
@@ -58,6 +58,7 @@ class TestSupport(unittest.TestCase):
mod_filename
=
TESTFN
+
'.py'
with
open
(
mod_filename
,
'w'
)
as
f
:
print
(
'foo = 1'
,
file
=
f
)
sys
.
path
.
insert
(
0
,
os
.
curdir
)
try
:
mod
=
__import__
(
TESTFN
)
self
.
assertIn
(
TESTFN
,
sys
.
modules
)
...
...
@@ -65,6 +66,7 @@ class TestSupport(unittest.TestCase):
support
.
forget
(
TESTFN
)
self
.
assertNotIn
(
TESTFN
,
sys
.
modules
)
finally
:
del
sys
.
path
[
0
]
support
.
unlink
(
mod_filename
)
def
test_HOST
(
self
):
...
...
Modules/posixmodule.c
View file @
8283a622
...
...
@@ -4616,7 +4616,7 @@ static PyObject *
sched_param_new
(
PyTypeObject
*
type
,
PyObject
*
args
,
PyObject
*
kwargs
)
{
PyObject
*
res
,
*
priority
;
static
char
*
kwlist
[]
=
{
"sched_priority"
};
static
char
*
kwlist
[]
=
{
"sched_priority"
,
NULL
};
if
(
!
PyArg_ParseTupleAndKeywords
(
args
,
kwargs
,
"O:sched_param"
,
kwlist
,
&
priority
))
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