Return +-Py_HUGE_VAL for tgamma(+-0) instead of risking FP exceptions by computing 1.0 / 0.0.
diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c
index cebb4ff..7e73bfe 100644
--- a/Modules/mathmodule.c
+++ b/Modules/mathmodule.c
@@ -239,7 +239,8 @@
     }
     if (x == 0.0) {
         errno = EDOM;
-        return 1.0/x; /* tgamma(+-0.0) = +-inf, divide-by-zero */
+        /* tgamma(+-0.0) = +-inf, divide-by-zero */
+        return copysign(Py_HUGE_VAL, x);
     }
 
     /* integer arguments */