File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -608,8 +608,7 @@ def test_float(self):
608608 if have_unicode :
609609 self .assertEqual (float (str (" 3.14 " )), 3.14 )
610610 self .assertEqual (float (str (b" \u0663.\u0661\u0664 " ,'raw-unicode-escape' )), 3.14 )
611- # Implementation limitation in PyFloat_FromString()
612- self .assertRaises (ValueError , float , str ("1" * 10000 ))
611+ self .assertEqual (float ("1" * 10000 ), 1e10000 ) # Inf on both sides
613612
614613 @run_with_locale ('LC_NUMERIC' , 'fr_FR' , 'de_DE' )
615614 def test_float_with_comma (self ):
Original file line number Diff line number Diff line change @@ -1230,7 +1230,7 @@ builtin_hex(PyObject *self, PyObject *v)
12301230 return NULL ;
12311231 }
12321232 res = (* nb -> nb_hex )(v );
1233- if (res && !PyString_Check (res )) {
1233+ if (res && !PyString_Check (res ) && ! PyUnicode_Check ( res ) ) {
12341234 PyErr_Format (PyExc_TypeError ,
12351235 "__hex__ returned non-string (type %.200s)" ,
12361236 res -> ob_type -> tp_name );
@@ -1430,7 +1430,7 @@ builtin_oct(PyObject *self, PyObject *v)
14301430 return NULL ;
14311431 }
14321432 res = (* nb -> nb_oct )(v );
1433- if (res && !PyString_Check (res )) {
1433+ if (res && !PyString_Check (res ) && ! PyUnicode_Check ( res ) ) {
14341434 PyErr_Format (PyExc_TypeError ,
14351435 "__oct__ returned non-string (type %.200s)" ,
14361436 res -> ob_type -> tp_name );
You can’t perform that action at this time.
0 commit comments