Default python is 3.6?

Steve Kargl sgk at troutmask.apl.washington.edu
Fri Apr 12 19:57:00 UTC 2019


On Fri, Apr 12, 2019 at 09:19:30PM +0200, Dima Pasechnik wrote:
> On Fri, Apr 12, 2019 at 6:29 PM Steve Kargl
> <sgk at troutmask.apl.washington.edu> wrote:
> >
> > On Fri, Apr 12, 2019 at 09:17:42AM -0700, Steve Kargl wrote:
> > >
> > > % find . -name math\*
> > > ./work/Python-3.6.8/Doc/library/math.rst
> > > ./work/Python-3.6.8/Modules/mathmodule.c
> > > ./work/Python-3.6.8/Lib/test/math_testcases.txt
> > > ./work/stage/usr/local/lib/python3.6/test/math_testcases.txt
> > >
> >
> > Well, this one is easy to fix.  I've sent this patch for 2 to 3
> > years now.  I've opened a PR about it.  Someday you guys might
> > actually fix this, because I will contacting core to get my
> > commit bit back.
> >
> This one is fixed in Python 3.7:
> https://github.com/python/cpython/blob/3.7/Modules/mathmodule.c
> via this commit:
> https://github.com/python/cpython/commit/4e6646fef5d2cc53422e4eca0b18201ed5a5c4b6
> 
> It is also fixed in Python 2.7.
> See https://github.com/python/cpython/pull/12027 for details.

Doesn't matter what the python developer have done.  A patch is
still required to build lang/python27.  Here's yet another 
copy of the patch.

--- ./Modules/mathmodule.c.orig	2019-04-12 10:00:28.518460000 -0700
+++ ./Modules/mathmodule.c	2019-04-12 10:01:24.846412000 -0700
@@ -71,7 +71,7 @@
 static const double sqrtpi = 1.772453850905516027298167483341145182798;
 
 static double
-sinpi(double x)
+_freebsd_ports_are_broken_sinpi(double x)
 {
     double y, r;
     int n;
@@ -270,7 +270,7 @@
        integer. */
     if (absx > 200.0) {
         if (x < 0.0) {
-            return 0.0/sinpi(x);
+            return 0.0/_freebsd_ports_are_broken_sinpi(x);
         }
         else {
             errno = ERANGE;
@@ -294,7 +294,7 @@
     }
     z = z * lanczos_g / y;
     if (x < 0.0) {
-        r = -pi / sinpi(absx) / absx * exp(y) / lanczos_sum(absx);
+        r = -pi / _freebsd_ports_are_broken_sinpi(absx) / absx * exp(y) / lanczos_sum(absx);
         r -= z * r;
         if (absx < 140.0) {
             r /= pow(y, absx - 0.5);
@@ -366,7 +366,7 @@
             (x-0.5)*(log(x+lanczos_g-0.5)-1);
     }
     else {
-        r = log(pi) - log(fabs(sinpi(absx))) - log(absx) -
+        r = log(pi) - log(fabs(_freebsd_ports_are_broken_sinpi(absx))) - log(absx) -
             (log(lanczos_sum(absx)) - lanczos_g +
              (absx-0.5)*(log(absx+lanczos_g-0.5)-1));
     }

-- 
Steve


More information about the freebsd-ports mailing list
OSZAR »