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
f4228b0e
Commit
f4228b0e
authored
Apr 02, 2012
by
Georg Brandl
Browse files
Options
Browse Files
Download
Plain Diff
Merge.
parents
d3fca8e0
9ee601e1
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
794 additions
and
771 deletions
+794
-771
Lib/multiprocessing/connection.py
Lib/multiprocessing/connection.py
+9
-0
Lib/test/test_multiprocessing.py
Lib/test/test_multiprocessing.py
+13
-1
Lib/test/test_xml_etree.py
Lib/test/test_xml_etree.py
+0
-10
Misc/NEWS
Misc/NEWS
+7
-0
Modules/_decimal/tests/bench.py
Modules/_decimal/tests/bench.py
+4
-1
Objects/bytearrayobject.c
Objects/bytearrayobject.c
+6
-2
Objects/typeobject.c
Objects/typeobject.c
+9
-13
PCbuild/_decimal.vcproj
PCbuild/_decimal.vcproj
+743
-743
Tools/msi/msi.py
Tools/msi/msi.py
+3
-1
No files found.
Lib/multiprocessing/connection.py
View file @
f4228b0e
...
...
@@ -104,6 +104,13 @@ def arbitrary_address(family):
else
:
raise
ValueError
(
'unrecognized family'
)
def
_validate_family
(
family
):
'''
Checks if the family is valid for the current environment.
'''
if
sys
.
platform
!=
'win32'
and
family
==
'AF_PIPE'
:
raise
ValueError
(
'Family %s is not recognized.'
%
family
)
def
address_type
(
address
):
'''
...
...
@@ -436,6 +443,7 @@ class Listener(object):
or
default_family
address
=
address
or
arbitrary_address
(
family
)
_validate_family
(
family
)
if
family
==
'AF_PIPE'
:
self
.
_listener
=
PipeListener
(
address
,
backlog
)
else
:
...
...
@@ -473,6 +481,7 @@ def Client(address, family=None, authkey=None):
Returns a connection to the address of a `Listener`
'''
family
=
family
or
address_type
(
address
)
_validate_family
(
family
)
if
family
==
'AF_PIPE'
:
c
=
PipeClient
(
address
)
else
:
...
...
Lib/test/test_multiprocessing.py
View file @
f4228b0e
...
...
@@ -2638,8 +2638,20 @@ class TestWait(unittest.TestCase):
p
.
join
()
#
# Issue 14151: Test invalid family on invalid environment
#
class
TestInvalidFamily
(
unittest
.
TestCase
):
@
unittest
.
skipIf
(
WIN32
,
"skipped on Windows"
)
def
test_invalid_family
(
self
):
with
self
.
assertRaises
(
ValueError
):
multiprocessing
.
connection
.
Listener
(
r'\\.\test'
)
testcases_other
=
[
OtherTest
,
TestInvalidHandle
,
TestInitializers
,
TestStdinBadfiledescriptor
,
TestWait
]
TestStdinBadfiledescriptor
,
TestWait
,
TestInvalidFamily
]
#
#
...
...
Lib/test/test_xml_etree.py
View file @
f4228b0e
...
...
@@ -1859,16 +1859,6 @@ class BasicElementTest(unittest.TestCase):
gc_collect
()
self
.
assertIsNone
(
wref
())
# A longer cycle: d->e->e2->d
e
=
ET
.
Element
(
'joe'
)
d
=
Dummy
()
d
.
dummyref
=
e
wref
=
weakref
.
ref
(
d
)
e2
=
ET
.
SubElement
(
e
,
'foo'
,
attr
=
d
)
del
d
,
e
,
e2
gc_collect
()
self
.
assertIsNone
(
wref
())
class
ElementTreeTest
(
unittest
.
TestCase
):
def
test_istype
(
self
):
...
...
Misc/NEWS
View file @
f4228b0e
...
...
@@ -10,9 +10,16 @@ What's New in Python 3.3.0 Alpha 3?
Core and Builtins
-----------------
- Issue #13019: Fix potential reference leaks in bytearray.extend(). Patch
by Suman Saha.
Library
-------
- Issue #14151: Raise a ValueError, not a NameError, when trying to create
a multiprocessing Client or Listener with an AF_PIPE type address under
non-Windows platforms. Patch by Popa Claudiu.
What'
s
New
in
Python
3.3.0
Alpha
2
?
===================================
...
...
Modules/_decimal/tests/bench.py
View file @
f4228b0e
...
...
@@ -84,7 +84,10 @@ print("\n# =====================================================================
print
(
"# Factorial"
)
print
(
"# ======================================================================
\
n
"
)
C
.
getcontext
().
prec
=
C
.
MAX_PREC
c
=
C
.
getcontext
()
c
.
prec
=
C
.
MAX_PREC
c
.
Emax
=
C
.
MAX_EMAX
c
.
Emin
=
C
.
MIN_EMIN
for
n
in
[
100000
,
1000000
]:
...
...
Objects/bytearrayobject.c
View file @
f4228b0e
...
...
@@ -2289,8 +2289,10 @@ bytearray_extend(PyByteArrayObject *self, PyObject *arg)
}
bytearray_obj
=
PyByteArray_FromStringAndSize
(
NULL
,
buf_size
);
if
(
bytearray_obj
==
NULL
)
if
(
bytearray_obj
==
NULL
)
{
Py_DECREF
(
it
);
return
NULL
;
}
buf
=
PyByteArray_AS_STRING
(
bytearray_obj
);
while
((
item
=
PyIter_Next
(
it
))
!=
NULL
)
{
...
...
@@ -2323,8 +2325,10 @@ bytearray_extend(PyByteArrayObject *self, PyObject *arg)
return
NULL
;
}
if
(
bytearray_setslice
(
self
,
Py_SIZE
(
self
),
Py_SIZE
(
self
),
bytearray_obj
)
==
-
1
)
if
(
bytearray_setslice
(
self
,
Py_SIZE
(
self
),
Py_SIZE
(
self
),
bytearray_obj
)
==
-
1
)
{
Py_DECREF
(
bytearray_obj
);
return
NULL
;
}
Py_DECREF
(
bytearray_obj
);
Py_RETURN_NONE
;
...
...
Objects/typeobject.c
View file @
f4228b0e
...
...
@@ -490,26 +490,22 @@ type_set_bases(PyTypeObject *type, PyObject *value, void *context)
for
(
i
=
0
;
i
<
PyTuple_GET_SIZE
(
value
);
i
++
)
{
ob
=
PyTuple_GET_ITEM
(
value
,
i
);
if
(
!
PyType_Check
(
ob
))
{
PyErr_Format
(
PyExc_TypeError
,
"%s.__bases__ must be tuple of classes, not '%s'"
,
type
->
tp_name
,
Py_TYPE
(
ob
)
->
tp_name
);
return
-
1
;
PyErr_Format
(
PyExc_TypeError
,
"%s.__bases__ must be tuple of classes, not '%s'"
,
type
->
tp_name
,
Py_TYPE
(
ob
)
->
tp_name
);
return
-
1
;
}
if
(
PyType_Check
(
ob
))
{
if
(
PyType_IsSubtype
((
PyTypeObject
*
)
ob
,
type
))
{
PyErr_SetString
(
PyExc_TypeError
,
"a __bases__ item causes an inheritance cycle"
);
return
-
1
;
}
if
(
PyType_IsSubtype
((
PyTypeObject
*
)
ob
,
type
))
{
PyErr_SetString
(
PyExc_TypeError
,
"a __bases__ item causes an inheritance cycle"
);
return
-
1
;
}
}
new_base
=
best_base
(
value
);
if
(
!
new_base
)
{
if
(
!
new_base
)
return
-
1
;
}
if
(
!
compatible_for_assignment
(
type
->
tp_base
,
new_base
,
"__bases__"
))
return
-
1
;
...
...
PCbuild/_decimal.vcproj
View file @
f4228b0e
This diff is collapsed.
Click to expand it.
Tools/msi/msi.py
View file @
f4228b0e
...
...
@@ -97,7 +97,9 @@ extensions = [
'_sqlite3.pyd'
,
'_hashlib.pyd'
,
'_multiprocessing.pyd'
,
'_lzma.pyd'
'_lzma.pyd'
,
'_decimal.pyd'
,
'_testbuffer.pyd'
]
# Well-known component UUIDs
...
...
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