Commits

Jesús Cea committed ebca4bd Draft

codesize tests must pass after dtrace patch is applied

Comments (0)

Files changed (1)

Lib/test/test_sys.py

         self.assertEqual(sys.getsizeof(True, -1), size('') + self.longdigit)
 
     def test_objecttypes(self):
+        import dtrace
         # check all types defined in Objects/
         size = test.support.calcobjsize
         vsize = test.support.calcvobjsize
             return inner
         check(get_cell().__closure__[0], size('P'))
         # code
-        check(get_cell().__code__, size('5i9Pi3P'))
-        check(get_cell.__code__, size('5i9Pi3P'))
+        if dtrace.available :
+            code = '5i9PiPH2P'
+        else :
+            code = '5i9Pi3P'
+        check(get_cell().__code__, size(code))
+        check(get_cell.__code__, size(code))
         def get_cell2(x):
             def inner():
                 return x
             return inner
-        check(get_cell2.__code__, size('5i9Pi3P') + 1)
+        check(get_cell2.__code__, size(code) + 1)
         # complex
         check(complex(0,1), size('2d'))
         # method_descriptor (descriptor object)