[arch-commits] Commit in python-logilab-common/trunk (PKGBUILD py38.patch)

Felix Yan felixonmars at archlinux.org
Mon Nov 4 08:32:47 UTC 2019


    Date: Monday, November 4, 2019 @ 08:32:46
  Author: felixonmars
Revision: 523766

add fix for python3.8

Added:
  python-logilab-common/trunk/py38.patch
Modified:
  python-logilab-common/trunk/PKGBUILD

------------+
 PKGBUILD   |    9 +++++-
 py38.patch |   81 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 88 insertions(+), 2 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2019-11-04 08:32:22 UTC (rev 523765)
+++ PKGBUILD	2019-11-04 08:32:46 UTC (rev 523766)
@@ -14,11 +14,16 @@
 optdepends=('python-six: for logilab.common.testlib')
 makedepends=('python-setuptools')
 checkdepends=('python-six' 'python-pytz')
-source=("https://pypi.io/packages/source/l/logilab-common/logilab-common-$pkgver.tar.gz")
-sha512sums=('6546df2f78e09ec7e02e12c8cb6e6f85b34be1dc5f79cc24351b0eb354c943c17410d22cb283a30b3912c48e7c93e0b04c648ae7620a6b4158e9b7240218e719')
+source=("https://pypi.io/packages/source/l/logilab-common/logilab-common-$pkgver.tar.gz"
+        py38.patch)
+sha512sums=('6546df2f78e09ec7e02e12c8cb6e6f85b34be1dc5f79cc24351b0eb354c943c17410d22cb283a30b3912c48e7c93e0b04c648ae7620a6b4158e9b7240218e719'
+            'bcd1ad3a7a80edfe12e6b595d915476a6506713c5d9cc03a95305a9bacfdfa135b1f95e84a252555a4844ee5bbf6b8e4c0ca0cfc3743836e24e618d64b1578d2')
 
 prepare() {
+  patch -d logilab-common-$pkgver -p1 -i ../py38.patch
   cp -a logilab-common-$pkgver{,-py2}
+
+  sed -i 's/from cgi import escape/from html import escape/' logilab-common-$pkgver/logilab/common/ureports/html_writer.py
 }
 
 build() {

Added: py38.patch
===================================================================
--- py38.patch	                        (rev 0)
+++ py38.patch	2019-11-04 08:32:46 UTC (rev 523766)
@@ -0,0 +1,81 @@
+
+# HG changeset patch
+# User Simon Chabot <simon.chabot at logilab.fr>
+# Date 1571921749 -7200
+# Node ID c8b3f9dee096a39cf37c429e296b2b408ce836d1
+# Parent  5bfba850fddf7f63508c74e40afa8ec9d0ba468b
+Use time.process_time instead of time.clock (deprecated)
+
+time.clock is deprecated since python 3.3 and will be removed in python 3.8
+
+this patch breaks backward compatibility with python < 3.3.
+
+diff -r 5bfba850fddf -r c8b3f9dee096 logilab/common/decorators.py
+--- a/logilab/common/decorators.py	Thu Sep 12 16:25:16 2019 +0200
++++ b/logilab/common/decorators.py	Thu Oct 24 14:55:49 2019 +0200
+@@ -23,7 +23,7 @@
+ 
+ import sys
+ import types
+-from time import clock, time
++from time import process_time, time
+ from inspect import isgeneratorfunction
+ 
+ import six
+@@ -232,10 +232,10 @@
+ def timed(f):
+     def wrap(*args, **kwargs):
+         t = time()
+-        c = clock()
++        c = process_time()
+         res = f(*args, **kwargs)
+         print('%s clock: %.9f / time: %.9f' % (f.__name__,
+-                                               clock() - c, time() - t))
++                                               process_time() - c, time() - t))
+         return res
+     return wrap
+ 
+diff -r 5bfba850fddf -r c8b3f9dee096 logilab/common/pytest.py
+--- a/logilab/common/pytest.py	Thu Sep 12 16:25:16 2019 +0200
++++ b/logilab/common/pytest.py	Thu Oct 24 14:55:49 2019 +0200
+@@ -115,7 +115,7 @@
+ 
+ import os, sys, re
+ import os.path as osp
+-from time import time, clock
++from time import process_time, time
+ import warnings
+ import types
+ import inspect
+@@ -385,7 +385,7 @@
+         print(('  %s  ' % osp.basename(filename)).center(70, '='),
+               file=sys.__stderr__)
+         try:
+-            tstart, cstart = time(), clock()
++            tstart, cstart = time(), process_time()
+             try:
+                 testprog = SkipAwareTestProgram(modname, batchmode=batchmode, cvg=self.cvg,
+                                                  options=self.options, outstream=sys.stderr)
+@@ -406,7 +406,7 @@
+                 traceback.print_exc(file=sys.stderr)
+                 return None
+ 
+-            tend, cend = time(), clock()
++            tend, cend = time(), process_time()
+             ttime, ctime = (tend - tstart), (cend - cstart)
+             self.report.feed(filename, testprog.result, ttime, ctime)
+             return testprog
+@@ -515,10 +515,10 @@
+               file=sys.stderr)
+         try:
+             try:
+-                tstart, cstart = time(), clock()
++                tstart, cstart = time(), process_time()
+                 self.before_testfile()
+                 testprog = SkipAwareTestProgram(modname, batchmode=batchmode, cvg=self.cvg)
+-                tend, cend = time(), clock()
++                tend, cend = time(), process_time()
+                 ttime, ctime = (tend - tstart), (cend - cstart)
+                 self.report.feed(filename, testprog.result, ttime, ctime)
+                 return testprog
+



More information about the arch-commits mailing list