Update Python to 3.11.0b4 in emscripten test (#2507)

* Update Python to 3.11.0b4 in emscripten test

* Print traceback when import exception failed

* Try `ALLOW_MEMORY_GROWTH=1`
This commit is contained in:
messense 2022-07-16 03:39:58 +08:00 committed by GitHub
parent de317a5667
commit a00e9d553d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 7 deletions

View File

@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: actions/setup-python@v4
- run: pip install nox
- uses: actions-rs/toolchain@v1
with:
@ -35,7 +35,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: actions/setup-python@v4
- run: pip install nox
- uses: actions-rs/toolchain@v1
with:
@ -152,7 +152,7 @@ jobs:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.platform.python-architecture }}
@ -324,7 +324,7 @@ jobs:
runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- uses: Swatinem/rust-cache@v1
@ -351,7 +351,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
id: setup-python
with:
python-version: 3.11-dev

View File

@ -3,7 +3,7 @@ CURDIR=$(abspath .)
# These three are passed in from nox.
BUILDROOT ?= $(CURDIR)/builddir
PYMAJORMINORMICRO ?= 3.11.0
PYPRERELEASE ?= b1 # I'm not sure how to split 3.11.0b1 in Make.
PYPRERELEASE ?= b4 # I'm not sure how to split 3.11.0b4 in Make.
EMSCRIPTEN_VERSION=3.1.13

View File

@ -187,6 +187,7 @@ def test_emscripten(session: nox.Session):
f"-C link-arg=-lpython{info.pymajorminor}",
"-C link-arg=-lexpat",
"-C link-arg=-lmpdec",
"-C link-arg=-sALLOW_MEMORY_GROWTH=1",
]
)
session.env["CARGO_BUILD_TARGET"] = target

View File

@ -108,7 +108,13 @@ macro_rules! import_exception {
.get_or_init(py, || {
let imp = py
.import(stringify!($module))
.expect(concat!("Can not import module: ", stringify!($module)));
.unwrap_or_else(|err| {
let traceback = err
.traceback(py)
.map(|tb| tb.format().expect("raised exception will have a traceback"))
.unwrap_or_default();
::std::panic!("Can not import module {}: {}\n{}", stringify!($module), err, traceback);
});
let cls = imp.getattr(stringify!($name)).expect(concat!(
"Can not load exception class: {}.{}",
stringify!($module),