This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients benjamin.peterson, gpolo, loewis, python-dev, serhiy.storchaka, vstinner
Date 2015-04-07.19:31:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1428435105.98.0.213059374787.issue16840@psf.upfronthosting.co.za>
In-reply-to
Content
test_expr_bignum() should tolerate the long type:

http://buildbot.python.org/all/builders/x86%20Tiger%202.7/builds/3007/steps/test/logs/stdio

======================================================================
FAIL: test_expr_bignum (test.test_tcl.TclTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/db3l/buildarea/2.7.bolen-tiger/build/Lib/test/test_tcl.py", line 443, in test_expr_bignum
    self.assertIsInstance(result, type(int(result)))
AssertionError: -2147483648L is not an instance of <type 'int'>

In fact, I don't understand the test self.assertIsInstance(result, type(int(result))). What do you expect from type(int(x)): int or long depending on the value of x? The problem is that an intermediate result may be a long and so tcl.call('expr', ..) returns a long even if it may fit into a small int.

I suggest to simply drop the test self.assertIsInstance(result, type(int(result))).
History
Date User Action Args
2015-04-07 19:31:46vstinnersetrecipients: + vstinner, loewis, benjamin.peterson, gpolo, python-dev, serhiy.storchaka
2015-04-07 19:31:45vstinnersetmessageid: <1428435105.98.0.213059374787.issue16840@psf.upfronthosting.co.za>
2015-04-07 19:31:45vstinnerlinkissue16840 messages
2015-04-07 19:31:45vstinnercreate