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
7e0e863e
Commit
7e0e863e
authored
Dec 16, 2013
by
Charles-François Natali
Browse files
Options
Browse Files
Download
Plain Diff
Merge.
parents
bba4bca9
72330dcf
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
50 additions
and
9 deletions
+50
-9
Lib/compileall.py
Lib/compileall.py
+2
-1
Lib/test/test_compileall.py
Lib/test/test_compileall.py
+23
-2
Lib/test/test_ftplib.py
Lib/test/test_ftplib.py
+4
-0
Lib/test/test_imaplib.py
Lib/test/test_imaplib.py
+4
-0
Lib/test/test_poplib.py
Lib/test/test_poplib.py
+5
-0
Lib/test/test_ssl.py
Lib/test/test_ssl.py
+2
-0
Misc/NEWS
Misc/NEWS
+3
-0
Modules/_decimal/libmpdec/mpdecimal.c
Modules/_decimal/libmpdec/mpdecimal.c
+4
-3
Objects/setobject.c
Objects/setobject.c
+3
-3
No files found.
Lib/compileall.py
View file @
7e0e863e
...
@@ -229,7 +229,8 @@ def main():
...
@@ -229,7 +229,8 @@ def main():
success
=
False
success
=
False
return
success
return
success
else
:
else
:
return
compile_path
(
legacy
=
args
.
legacy
)
return
compile_path
(
legacy
=
args
.
legacy
,
force
=
args
.
force
,
quiet
=
args
.
quiet
)
except
KeyboardInterrupt
:
except
KeyboardInterrupt
:
print
(
"
\
n
[interrupted]"
)
print
(
"
\
n
[interrupted]"
)
return
False
return
False
...
...
Lib/test/test_compileall.py
View file @
7e0e863e
...
@@ -5,8 +5,6 @@ import os
...
@@ -5,8 +5,6 @@ import os
import
py_compile
import
py_compile
import
shutil
import
shutil
import
struct
import
struct
import
subprocess
import
sys
import
tempfile
import
tempfile
import
time
import
time
import
unittest
import
unittest
...
@@ -181,6 +179,29 @@ class CommandLineTests(unittest.TestCase):
...
@@ -181,6 +179,29 @@ class CommandLineTests(unittest.TestCase):
self
.
assertNotCompiled
(
self
.
initfn
)
self
.
assertNotCompiled
(
self
.
initfn
)
self
.
assertNotCompiled
(
self
.
barfn
)
self
.
assertNotCompiled
(
self
.
barfn
)
def
test_no_args_respects_force_flag
(
self
):
bazfn
=
script_helper
.
make_script
(
self
.
directory
,
'baz'
,
''
)
self
.
assertRunOK
(
PYTHONPATH
=
self
.
directory
)
pycpath
=
importlib
.
util
.
cache_from_source
(
bazfn
)
# Set atime/mtime backward to avoid file timestamp resolution issues
os
.
utime
(
pycpath
,
(
time
.
time
()
-
60
,)
*
2
)
mtime
=
os
.
stat
(
pycpath
).
st_mtime
# Without force, no recompilation
self
.
assertRunOK
(
PYTHONPATH
=
self
.
directory
)
mtime2
=
os
.
stat
(
pycpath
).
st_mtime
self
.
assertEqual
(
mtime
,
mtime2
)
# Now force it.
self
.
assertRunOK
(
'-f'
,
PYTHONPATH
=
self
.
directory
)
mtime2
=
os
.
stat
(
pycpath
).
st_mtime
self
.
assertNotEqual
(
mtime
,
mtime2
)
def
test_no_args_respects_quiet_flag
(
self
):
script_helper
.
make_script
(
self
.
directory
,
'baz'
,
''
)
noisy
=
self
.
assertRunOK
(
PYTHONPATH
=
self
.
directory
)
self
.
assertIn
(
b'Listing '
,
noisy
)
quiet
=
self
.
assertRunOK
(
'-q'
,
PYTHONPATH
=
self
.
directory
)
self
.
assertNotIn
(
b'Listing '
,
quiet
)
# Ensure that the default behavior of compileall's CLI is to create
# Ensure that the default behavior of compileall's CLI is to create
# PEP 3147 pyc/pyo files.
# PEP 3147 pyc/pyo files.
for
name
,
ext
,
switch
in
[
for
name
,
ext
,
switch
in
[
...
...
Lib/test/test_ftplib.py
View file @
7e0e863e
...
@@ -15,6 +15,9 @@ try:
...
@@ -15,6 +15,9 @@ try:
import
ssl
import
ssl
except
ImportError
:
except
ImportError
:
ssl
=
None
ssl
=
None
HAS_SNI
=
False
else
:
from
ssl
import
HAS_SNI
from
unittest
import
TestCase
,
skipUnless
from
unittest
import
TestCase
,
skipUnless
from
test
import
support
from
test
import
support
...
@@ -924,6 +927,7 @@ class TestTLS_FTPClass(TestCase):
...
@@ -924,6 +927,7 @@ class TestTLS_FTPClass(TestCase):
self
.
client
.
ccc
()
self
.
client
.
ccc
()
self
.
assertRaises
(
ValueError
,
self
.
client
.
sock
.
unwrap
)
self
.
assertRaises
(
ValueError
,
self
.
client
.
sock
.
unwrap
)
@
skipUnless
(
HAS_SNI
,
'No SNI support in ssl module'
)
def
test_check_hostname
(
self
):
def
test_check_hostname
(
self
):
self
.
client
.
quit
()
self
.
client
.
quit
()
ctx
=
ssl
.
SSLContext
(
ssl
.
PROTOCOL_TLSv1
)
ctx
=
ssl
.
SSLContext
(
ssl
.
PROTOCOL_TLSv1
)
...
...
Lib/test/test_imaplib.py
View file @
7e0e863e
...
@@ -18,6 +18,9 @@ try:
...
@@ -18,6 +18,9 @@ try:
import
ssl
import
ssl
except
ImportError
:
except
ImportError
:
ssl
=
None
ssl
=
None
HAS_SNI
=
False
else
:
from
ssl
import
HAS_SNI
CERTFILE
=
None
CERTFILE
=
None
CAFILE
=
None
CAFILE
=
None
...
@@ -349,6 +352,7 @@ class ThreadedNetworkedTestsSSL(BaseThreadedNetworkedTests):
...
@@ -349,6 +352,7 @@ class ThreadedNetworkedTestsSSL(BaseThreadedNetworkedTests):
imap_class
=
IMAP4_SSL
imap_class
=
IMAP4_SSL
@
reap_threads
@
reap_threads
@
unittest
.
skipUnless
(
HAS_SNI
,
'No SNI support in ssl module'
)
def
test_ssl_verified
(
self
):
def
test_ssl_verified
(
self
):
ssl_context
=
ssl
.
SSLContext
(
ssl
.
PROTOCOL_SSLv23
)
ssl_context
=
ssl
.
SSLContext
(
ssl
.
PROTOCOL_SSLv23
)
ssl_context
.
verify_mode
=
ssl
.
CERT_REQUIRED
ssl_context
.
verify_mode
=
ssl
.
CERT_REQUIRED
...
...
Lib/test/test_poplib.py
View file @
7e0e863e
...
@@ -21,10 +21,14 @@ PORT = 0
...
@@ -21,10 +21,14 @@ PORT = 0
SUPPORTS_SSL
=
False
SUPPORTS_SSL
=
False
if
hasattr
(
poplib
,
'POP3_SSL'
):
if
hasattr
(
poplib
,
'POP3_SSL'
):
import
ssl
import
ssl
from
ssl
import
HAS_SNI
SUPPORTS_SSL
=
True
SUPPORTS_SSL
=
True
CERTFILE
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
)
or
os
.
curdir
,
"keycert3.pem"
)
CERTFILE
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
)
or
os
.
curdir
,
"keycert3.pem"
)
CAFILE
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
)
or
os
.
curdir
,
"pycacert.pem"
)
CAFILE
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
)
or
os
.
curdir
,
"pycacert.pem"
)
else
:
HAS_SNI
=
False
requires_ssl
=
skipUnless
(
SUPPORTS_SSL
,
'SSL not supported'
)
requires_ssl
=
skipUnless
(
SUPPORTS_SSL
,
'SSL not supported'
)
# the dummy data returned by server when LIST and RETR commands are issued
# the dummy data returned by server when LIST and RETR commands are issued
...
@@ -330,6 +334,7 @@ class TestPOP3Class(TestCase):
...
@@ -330,6 +334,7 @@ class TestPOP3Class(TestCase):
self
.
assertEqual
(
resp
,
expected
)
self
.
assertEqual
(
resp
,
expected
)
@
requires_ssl
@
requires_ssl
@
skipUnless
(
HAS_SNI
,
'No SNI support in ssl module'
)
def
test_stls_context
(
self
):
def
test_stls_context
(
self
):
expected
=
b'+OK Begin TLS negotiation'
expected
=
b'+OK Begin TLS negotiation'
ctx
=
ssl
.
SSLContext
(
ssl
.
PROTOCOL_TLSv1
)
ctx
=
ssl
.
SSLContext
(
ssl
.
PROTOCOL_TLSv1
)
...
...
Lib/test/test_ssl.py
View file @
7e0e863e
...
@@ -1419,6 +1419,7 @@ class NetworkedTests(unittest.TestCase):
...
@@ -1419,6 +1419,7 @@ class NetworkedTests(unittest.TestCase):
s
.
close
()
s
.
close
()
self
.
assertEqual
(
len
(
ctx
.
get_ca_certs
()),
1
)
self
.
assertEqual
(
len
(
ctx
.
get_ca_certs
()),
1
)
@
needs_sni
def
test_context_setget
(
self
):
def
test_context_setget
(
self
):
# Check that the context of a connected socket can be replaced.
# Check that the context of a connected socket can be replaced.
with
support
.
transient_internet
(
"svn.python.org"
):
with
support
.
transient_internet
(
"svn.python.org"
):
...
@@ -1970,6 +1971,7 @@ else:
...
@@ -1970,6 +1971,7 @@ else:
cert
=
s
.
getpeercert
()
cert
=
s
.
getpeercert
()
self
.
assertTrue
(
cert
,
"Can't get peer certificate."
)
self
.
assertTrue
(
cert
,
"Can't get peer certificate."
)
@
needs_sni
def
test_check_hostname
(
self
):
def
test_check_hostname
(
self
):
if
support
.
verbose
:
if
support
.
verbose
:
sys
.
stdout
.
write
(
"
\
n
"
)
sys
.
stdout
.
write
(
"
\
n
"
)
...
...
Misc/NEWS
View file @
7e0e863e
...
@@ -44,6 +44,9 @@ Core and Builtins
...
@@ -44,6 +44,9 @@ Core and Builtins
Library
Library
-------
-------
- Issue #19532: python -m compileall with no filename/directory arguments now
respects the -f and -q flags instead of ignoring them.
- Issue #19623: Fixed writing to unseekable files in the aifc module.
- Issue #19623: Fixed writing to unseekable files in the aifc module.
- Issue #19946: multiprocessing.spawn now raises ImportError when the module to
- Issue #19946: multiprocessing.spawn now raises ImportError when the module to
...
...
Modules/_decimal/libmpdec/mpdecimal.c
View file @
7e0e863e
...
@@ -4421,21 +4421,22 @@ mpd_qfma(mpd_t *result, const mpd_t *a, const mpd_t *b, const mpd_t *c,
...
@@ -4421,21 +4421,22 @@ mpd_qfma(mpd_t *result, const mpd_t *a, const mpd_t *b, const mpd_t *c,
const
mpd_context_t
*
ctx
,
uint32_t
*
status
)
const
mpd_context_t
*
ctx
,
uint32_t
*
status
)
{
{
uint32_t
workstatus
=
0
;
uint32_t
workstatus
=
0
;
const
mpd_t
*
cc
=
c
;
mpd_t
*
cc
=
NULL
;
if
(
result
==
c
)
{
if
(
result
==
c
)
{
if
((
cc
=
mpd_qncopy
(
c
))
==
NULL
)
{
if
((
cc
=
mpd_qncopy
(
c
))
==
NULL
)
{
mpd_seterror
(
result
,
MPD_Malloc_error
,
status
);
mpd_seterror
(
result
,
MPD_Malloc_error
,
status
);
return
;
return
;
}
}
c
=
cc
;
}
}
_mpd_qmul
(
result
,
a
,
b
,
ctx
,
&
workstatus
);
_mpd_qmul
(
result
,
a
,
b
,
ctx
,
&
workstatus
);
if
(
!
(
workstatus
&
MPD_Invalid_operation
))
{
if
(
!
(
workstatus
&
MPD_Invalid_operation
))
{
mpd_qadd
(
result
,
result
,
c
c
,
ctx
,
&
workstatus
);
mpd_qadd
(
result
,
result
,
c
,
ctx
,
&
workstatus
);
}
}
if
(
cc
!=
c
)
mpd_del
((
mpd_t
*
)
cc
);
if
(
cc
)
mpd_del
(
cc
);
*
status
|=
workstatus
;
*
status
|=
workstatus
;
}
}
...
...
Objects/setobject.c
View file @
7e0e863e
...
@@ -36,9 +36,6 @@ static PyObject _dummy_struct;
...
@@ -36,9 +36,6 @@ static PyObject _dummy_struct;
#define dummy (&_dummy_struct)
#define dummy (&_dummy_struct)
/* Exported for the gdb plugin's benefit. */
PyObject
*
_PySet_Dummy
=
dummy
;
/* ======================================================================== */
/* ======================================================================== */
/* ======= Begin logic for probing the hash table ========================= */
/* ======= Begin logic for probing the hash table ========================= */
...
@@ -2345,6 +2342,9 @@ _PySet_Update(PyObject *set, PyObject *iterable)
...
@@ -2345,6 +2342,9 @@ _PySet_Update(PyObject *set, PyObject *iterable)
return
set_update_internal
((
PySetObject
*
)
set
,
iterable
);
return
set_update_internal
((
PySetObject
*
)
set
,
iterable
);
}
}
/* Exported for the gdb plugin's benefit. */
PyObject
*
_PySet_Dummy
=
dummy
;
#ifdef Py_DEBUG
#ifdef Py_DEBUG
/* Test code to be called with any three element set.
/* Test code to be called with any three element set.
...
...
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