From ef87d6ed94780fe00250a551031023aeb2898365 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Wed, 2 May 2007 19:09:54 +0000 Subject: Rip out all the u"..." literals and calls to unicode(). --- Lib/sqlite3/test/factory.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'Lib/sqlite3/test/factory.py') diff --git a/Lib/sqlite3/test/factory.py b/Lib/sqlite3/test/factory.py index 8a77d5d709..61edc6c5c0 100644 --- a/Lib/sqlite3/test/factory.py +++ b/Lib/sqlite3/test/factory.py @@ -139,31 +139,31 @@ class TextFactoryTests(unittest.TestCase): self.con = sqlite.connect(":memory:") def CheckUnicode(self): - austria = unicode("Österreich", "latin1") + austria = str("Österreich", "latin1") row = self.con.execute("select ?", (austria,)).fetchone() - self.failUnless(type(row[0]) == unicode, "type of row[0] must be unicode") + self.failUnless(type(row[0]) == str, "type of row[0] must be unicode") def CheckString(self): self.con.text_factory = str - austria = unicode("Österreich", "latin1") + austria = str("Österreich", "latin1") row = self.con.execute("select ?", (austria,)).fetchone() self.failUnless(type(row[0]) == str, "type of row[0] must be str") self.failUnless(row[0] == austria.encode("utf-8"), "column must equal original data in UTF-8") def CheckCustom(self): - self.con.text_factory = lambda x: unicode(x, "utf-8", "ignore") - austria = unicode("Österreich", "latin1") + self.con.text_factory = lambda x: str(x, "utf-8", "ignore") + austria = str("Österreich", "latin1") row = self.con.execute("select ?", (austria.encode("latin1"),)).fetchone() - self.failUnless(type(row[0]) == unicode, "type of row[0] must be unicode") - self.failUnless(row[0].endswith(u"reich"), "column must contain original data") + self.failUnless(type(row[0]) == str, "type of row[0] must be unicode") + self.failUnless(row[0].endswith("reich"), "column must contain original data") def CheckOptimizedUnicode(self): self.con.text_factory = sqlite.OptimizedUnicode - austria = unicode("Österreich", "latin1") - germany = unicode("Deutchland") + austria = str("Österreich", "latin1") + germany = str("Deutchland") a_row = self.con.execute("select ?", (austria,)).fetchone() d_row = self.con.execute("select ?", (germany,)).fetchone() - self.failUnless(type(a_row[0]) == unicode, "type of non-ASCII row must be unicode") + self.failUnless(type(a_row[0]) == str, "type of non-ASCII row must be unicode") self.failUnless(type(d_row[0]) == str, "type of ASCII-only row must be str") def tearDown(self): -- cgit v1.2.1