Skip to content

Commit

Permalink
Update Python to 3.11.0b4 in emscripten test (#2507)
Browse files Browse the repository at this point in the history
* Update Python to 3.11.0b4 in emscripten test

* Print traceback when import exception failed

* Try `ALLOW_MEMORY_GROWTH=1`
  • Loading branch information
messense committed Jul 15, 2022
1 parent de317a5 commit a00e9d5
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Expand Up @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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 }}
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion emscripten/Makefile
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions noxfile.py
Expand Up @@ -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
Expand Down
8 changes: 7 additions & 1 deletion src/exceptions.rs
Expand Up @@ -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),
Expand Down

0 comments on commit a00e9d5

Please sign in to comment.