mirror of
https://github.com/python/cpython.git
synced 2025-11-10 02:21:40 +00:00
Sets the compiler attribute to keep the old behavior for third-party packages.
This commit is contained in:
parent
5fd3af24a2
commit
42b145d0e2
2 changed files with 29 additions and 4 deletions
|
|
@ -402,12 +402,21 @@ def test_compiler_deprecation_warning(self):
|
|||
dist = Distribution()
|
||||
cmd = build_ext(dist)
|
||||
|
||||
class MyCompiler(object):
|
||||
def do_something(self):
|
||||
pass
|
||||
|
||||
with check_warnings() as w:
|
||||
warnings.simplefilter("always")
|
||||
cmd.compiler = object()
|
||||
cmd.compiler = MyCompiler()
|
||||
self.assertEquals(len(w.warnings), 1)
|
||||
cmd.compile = 'unix'
|
||||
self.assertEquals(len(w.warnings), 1)
|
||||
cmd.compiler = MyCompiler()
|
||||
cmd.compiler.do_something()
|
||||
# two more warnings genereated by the get
|
||||
# and the set
|
||||
self.assertEquals(len(w.warnings), 3)
|
||||
|
||||
def test_suite():
|
||||
src = _get_source_filename()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue