From: Robert Schuppenies Date: Tue, 17 Jun 2008 08:42:15 +0000 (+0000) Subject: Issue 3048: Fixed sys.sizeof test fails with wide unicode. X-Git-Tag: v2.6b1~18 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=59f3ade862dc885ddc4499227256079625d690a2;p=thirdparty%2FPython%2Fcpython.git Issue 3048: Fixed sys.sizeof test fails with wide unicode. --- diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py index 20628385d75e..f1fb61549e24 100644 --- a/Lib/test/test_sys.py +++ b/Lib/test/test_sys.py @@ -538,8 +538,7 @@ class SizeofTest(unittest.TestCase): self.check_sizeof([], h + l + p + l) self.check_sizeof([1, 2, 3], h + l + p + l + 3*l) # unicode - import math - usize = math.log(sys.maxunicode + 1, 2) / 8 + usize = len(u'\0'.encode('unicode-internal')) samples = [u'', u'1'*100] # we need to test for both sizes, because we don't know if the string # has been cached