Issue #5829: complex('1e-500') shouldn't raise an exception.
Also fix some confusing indentation.
diff --git a/Objects/complexobject.c b/Objects/complexobject.c
index 9943d0d..8ce61b7 100644
--- a/Objects/complexobject.c
+++ b/Objects/complexobject.c
@@ -995,16 +995,16 @@
 			}
 			errno = 0;
 			PyFPE_START_PROTECT("strtod", return 0)
-				z = PyOS_ascii_strtod(s, &end) ;
+			z = PyOS_ascii_strtod(s, &end) ;
 			PyFPE_END_PROTECT(z)
-				if (errno != 0) {
-					PyOS_snprintf(buffer, sizeof(buffer),
-					  "float() out of range: %.150s", s);
-					PyErr_SetString(
-						PyExc_ValueError,
-						buffer);
-					return NULL;
-				}
+			if (errno == ERANGE && fabs(z) >= 1.0) {
+				PyOS_snprintf(buffer, sizeof(buffer),
+					"float() out of range: %.150s", s);
+				PyErr_SetString(
+					PyExc_ValueError,
+					buffer);
+				return NULL;
+			}
 			s=end;
 			if  (*s=='J' || *s=='j') {