diff options
Diffstat (limited to 'Lib/test/test_format.py')
-rw-r--r-- | Lib/test/test_format.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_format.py b/Lib/test/test_format.py index 2959447..a9b3170 100644 --- a/Lib/test/test_format.py +++ b/Lib/test/test_format.py @@ -230,6 +230,14 @@ test_exc(u'no format', '1', TypeError, test_exc(u'no format', u'1', TypeError, "not all arguments converted during string formatting") +class Foobar(long): + def __oct__(self): + # Returning a non-string should not blow up. + return self + 1 + +test_exc('%o', Foobar(), TypeError, + "expected string or Unicode object, long found") + if sys.maxint == 2**31-1: # crashes 2.2.1 and earlier: try: |