Refs #23919 -- Stopped inheriting from object to define new style classes.

This commit is contained in:
Simon Charette 2017-01-19 02:39:46 -05:00 committed by Claude Paroz
parent a556396339
commit cecc079168
293 changed files with 512 additions and 514 deletions

View file

@ -167,7 +167,7 @@ class TestUtilsHtml(SimpleTestCase):
def test_html_safe(self):
@html.html_safe
class HtmlClass(object):
class HtmlClass:
def __str__(self):
return "<h1>I'm a html class!</h1>"
@ -177,7 +177,7 @@ class TestUtilsHtml(SimpleTestCase):
self.assertEqual(force_text(html_obj), html_obj.__html__())
def test_html_safe_subclass(self):
class BaseClass(object):
class BaseClass:
def __html__(self):
# defines __html__ on its own
return 'some html content'
@ -198,7 +198,7 @@ class TestUtilsHtml(SimpleTestCase):
msg = "can't apply @html_safe to HtmlClass because it defines __html__()."
with self.assertRaisesMessage(ValueError, msg):
@html.html_safe
class HtmlClass(object):
class HtmlClass:
def __html__(self):
return "<h1>I'm a html class!</h1>"
@ -206,5 +206,5 @@ class TestUtilsHtml(SimpleTestCase):
msg = "can't apply @html_safe to HtmlClass because it doesn't define __str__()."
with self.assertRaisesMessage(ValueError, msg):
@html.html_safe
class HtmlClass(object):
class HtmlClass:
pass