Skip to content
Snippets Groups Projects
Commit 4716ebff authored by Antonio Rojas's avatar Antonio Rojas
Browse files

Port py3 module away from deprecated imp

parent a296e694
No related branches found
Tags 4.88-1
No related merge requests found
......@@ -2,7 +2,7 @@
pkgname=brial
pkgver=1.2.5
pkgrel=3
pkgrel=4
pkgdesc="Library for polynomials over boolean rings"
arch=(x86_64)
url="https://github.com/BRiAl/BRiAl"
......@@ -10,11 +10,16 @@ license=(GPL)
depends=(m4ri)
makedepends=(boost python python2)
optdepends=('python: Python 3 bindings' 'python2: Python 2 bindings')
source=("https://github.com/BRiAl/BRiAl/releases/download/$pkgver/brial-$pkgver.tar.bz2")
sha256sums=('c4921d5008ac9122452e6f93abb696ef21ceac8e7170008ea7c7b05508da8d34')
source=("https://github.com/BRiAl/BRiAl/releases/download/$pkgver/brial-$pkgver.tar.bz2"
brial-imp.patch)
sha256sums=('c4921d5008ac9122452e6f93abb696ef21ceac8e7170008ea7c7b05508da8d34'
'2f16ac32f905980ea49e2a4cdc7d44a3eec4d794e4cbde24a583a8d1045df2f8')
prepare() {
cp -r $pkgname-$pkgver/sage-brial{,-py2}
cd $pkgname-$pkgver/sage-brial
patch -p1 -i "$srcdir"/brial-imp.patch # For away from deprecated imp module
}
build() {
......
--- sage-brial/brial/gbrefs.py.orig 2019-09-01 22:09:29.585226434 +0000
+++ sage-brial/brial/gbrefs.py 2019-09-01 22:10:49.416270516 +0000
@@ -6,7 +6,7 @@
from io import StringIO
import uu
import re
-import imp
+import types
from .PyPolyBoRi import *
AUTO = "auto"
SINGLE = "single"
@@ -118,7 +118,7 @@
def dyn_generate(content, name):
- module = imp.new_module(name)
+ module = types.ModuleType(name)
import_header = """from .PyPolyBoRi import Variable,Monomial, Polynomial, Ring, OrderCode
from itertools import chain
from .blocks import AlternatingBlock,Block,AdderBlock,if_then,HigherOrderBlock,declare_ring as orig_declare_ring,declare_block_scheme,MacroBlock\n
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment