Author: Armin Rigo <[email protected]>
Branch: py3.5
Changeset: r89414:6f5a8cd7e3b2
Date: 2017-01-08 15:59 +0100
http://bitbucket.org/pypy/pypy/changeset/6f5a8cd7e3b2/
Log: Fix the check for "is a built-in function"
diff --git a/lib-python/3/test/test_warnings/__init__.py
b/lib-python/3/test/test_warnings/__init__.py
--- a/lib-python/3/test/test_warnings/__init__.py
+++ b/lib-python/3/test/test_warnings/__init__.py
@@ -561,8 +561,9 @@
# As an early adopter, we sanity check the
# test.support.import_fresh_module utility function
def test_accelerated(self):
+ import types
self.assertFalse(original_warnings is self.module)
- self.assertFalse(hasattr(self.module.warn, '__code__'))
+ self.assertIs(type(self.module.warn), types.BuiltinFunctionType)
class PyWarnTests(WarnTests, unittest.TestCase):
module = py_warnings
@@ -570,8 +571,9 @@
# As an early adopter, we sanity check the
# test.support.import_fresh_module utility function
def test_pure_python(self):
+ import types
self.assertFalse(original_warnings is self.module)
- self.assertTrue(hasattr(self.module.warn, '__code__'))
+ self.assertIs(type(self.module.warn), types.FunctionType)
class WCmdLineTests(BaseTest):
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit