Compare commits

38 Commits

Author SHA256 Message Date
0adad007b0 Accepting request 1296221 from devel:languages:python
- Update to 2.5:
  * Lua uses dlopen() again, which was lost in Lupa 2.3.
  * Built with Cython 3.1.2.
  * Failures in the test suite didn't set a non-zero process exit value.
  * Removed support for Python 2.x.
  * Built with Cython 3.0.11.
  * A new method LuaRuntime.gccollect() was added to trigger the Lua garbage
    collector.
  * A new context manager LuaRuntime.nogc() was added to temporarily disable
    the Lua garbage collector.
  * The table_from() method gained a new keyword argument recursive=False.
  * The LuaRuntime methods "eval", "execute" and "compile" gained new keyword
    options mode and name that allow constraining the input type and
    modifying the (chunk) name shown in error messages, following similar
    arguments in the Lua load() function.
  * Loading Lua modules did not work for the version specific Lua modules
    introduced in Lupa 2.0. It turned out that it can only be enabled for one
    of them in a given Python run, so it is now left to users to enable it
    explicitly at need.
  * Built with Cython 3.0.9 for improved support of Python 3.12/13.
- Drop patches, included upstream:
  * no-bundle.patch
  * noexcept.patch

OBS-URL: https://build.opensuse.org/request/show/1296221
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-lupa?expand=0&rev=19
2025-07-30 09:44:20 +00:00
a9a39d7e96 Accepting request 1281777 from devel:languages:python
- Convert to pip-based build

OBS-URL: https://build.opensuse.org/request/show/1281777
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-lupa?expand=0&rev=18
2025-06-02 20:00:25 +00:00
23d0b26aec - Convert to pip-based build
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-lupa?expand=0&rev=32
2025-06-02 07:59:05 +00:00
b32de0aaf6 Accepting request 1118276 from devel:languages:python
- Add upstream patches to built with Cython 3.0.3:
  - Add no-bundle.patch gh#scoder/lupa@19279acda1ad
  - Add noexcept.patch gh#scoder/lupa@fc0a1af99b74
- Update to 2.0:
  - GH#217: Lua stack traces in Python exception messages are now
    reversed to match the order of Python stack traces.
  - GH#196: Lupa now ships separate extension modules built with Lua
    5.3, Lua 5.4, LuaJIT 2.0 and LuaJIT 2.1 beta. Note that this is
    build specific and may depend on the platform. A normal Python
    import cascade can be used.
  - GH#211: A new option max_memory allows to limit the memory usage
    of Lua code. (patch by Leo Developer)
  - GH#171: Python references in Lua are now more safely reference
    counted to prevent garbage collection glitches. (patch by
    Guilherme Dantas)
  - GH#146: Lua integers in Lua 5.3+ are converted from and to Python
    integers. (patch by Guilherme Dantas)
  - GH#180: The python.enumerate() function now returns indices as
    integers if supported by Lua. (patch by Guilherme Dantas)
  - GH#178: The Lua integer limits can be read from the module as
    LUA_MAXINTEGER and LUA_MININTEGER. (patch by Guilherme Dantas)
  - GH#174: Failures while calling the __index method in Lua during a
    table index lookup from Python could crash Python. (patch by
    Guilherme Dantas)
  - GH#137: Passing None as a dict key into table_from() crashed.
    (patch by Leo Developer)
  - GH#176: A new function python.args(*args, **kwargs) was added to
    help with building Python argument tuples and keyword argument
    dicts for Python function calls from Lua code.
  - GH#177: Tables that are not sequences raise IndexError when
    unpacking them. Previously, non-sequential items were simply
    ignored.
  - GH#179: Resolve some C compiler warnings about signed/unsigned
    comparisons. (patch by Guilherme Dantas)
  - Built with Cython 0.29.34.

OBS-URL: https://build.opensuse.org/request/show/1118276
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-lupa?expand=0&rev=17
2023-10-19 20:47:12 +00:00
bb832bb077 - Add upstream patches to built with Cython 3.0.3:
- Add no-bundle.patch gh#scoder/lupa@19279acda1ad
  - Add noexcept.patch gh#scoder/lupa@fc0a1af99b74
- Update to 2.0:
  - GH#217: Lua stack traces in Python exception messages are now
    reversed to match the order of Python stack traces.
  - GH#196: Lupa now ships separate extension modules built with Lua
    5.3, Lua 5.4, LuaJIT 2.0 and LuaJIT 2.1 beta. Note that this is
    build specific and may depend on the platform. A normal Python
    import cascade can be used.
  - GH#211: A new option max_memory allows to limit the memory usage
    of Lua code. (patch by Leo Developer)
  - GH#171: Python references in Lua are now more safely reference
    counted to prevent garbage collection glitches. (patch by
    Guilherme Dantas)
  - GH#146: Lua integers in Lua 5.3+ are converted from and to Python
    integers. (patch by Guilherme Dantas)
  - GH#180: The python.enumerate() function now returns indices as
    integers if supported by Lua. (patch by Guilherme Dantas)
  - GH#178: The Lua integer limits can be read from the module as
    LUA_MAXINTEGER and LUA_MININTEGER. (patch by Guilherme Dantas)
  - GH#174: Failures while calling the __index method in Lua during a
    table index lookup from Python could crash Python. (patch by
    Guilherme Dantas)
  - GH#137: Passing None as a dict key into table_from() crashed.
    (patch by Leo Developer)
  - GH#176: A new function python.args(*args, **kwargs) was added to
    help with building Python argument tuples and keyword argument
    dicts for Python function calls from Lua code.
  - GH#177: Tables that are not sequences raise IndexError when

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-lupa?expand=0&rev=30
2023-10-17 10:17:44 +00:00
0644302b18 Accepting request 1102379 from devel:languages:python
- Synchronize architectures where luajit is Required with those
  where it is build (riscv64 ppc64 ppc64le s390x).

OBS-URL: https://build.opensuse.org/request/show/1102379
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-lupa?expand=0&rev=16
2023-08-05 10:54:57 +00:00
77bdb01fcd - Synchronize architectures where luajit is Required with those
where it is build (riscv64 ppc64 ppc64le s390x).

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-lupa?expand=0&rev=28
2023-08-04 11:46:10 +00:00
08accf5388 Accepting request 1092248 from devel:languages:python
- Add %{?sle15_python_module_pythons}

OBS-URL: https://build.opensuse.org/request/show/1092248
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-lupa?expand=0&rev=15
2023-06-12 13:24:45 +00:00
6ea6de04c8 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-lupa?expand=0&rev=26 2023-06-11 11:43:08 +00:00
5ef575ab74 Accepting request 1092106 from home:ecsos:python
- Add %{?sle15_python_module_pythons}

OBS-URL: https://build.opensuse.org/request/show/1092106
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-lupa?expand=0&rev=25
2023-06-11 11:42:42 +00:00
394f92cb07 Accepting request 1039911 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/1039911
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-lupa?expand=0&rev=14
2022-12-05 17:00:31 +00:00
9f55e5e33d Accepting request 1039853 from home:yarunachalam:branches:devel:languages:python
- Update to version 1.14.1 
  * Rebuild with Cython 0.29.32 to support Python 3.11.

OBS-URL: https://build.opensuse.org/request/show/1039853
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-lupa?expand=0&rev=23
2022-12-03 22:35:38 +00:00
e65c042dcc Accepting request 1029884 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/1029884
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-lupa?expand=0&rev=13
2022-10-20 09:09:34 +00:00
15b6394ba6 Accepting request 1029800 from home:AdaLovelace:branches:devel:languages:python
- No upstream LuaJIT on s390x

OBS-URL: https://build.opensuse.org/request/show/1029800
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-lupa?expand=0&rev=21
2022-10-18 22:28:49 +00:00
78d51995ba Accepting request 1007069 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/1007069
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-lupa?expand=0&rev=12
2022-10-03 11:44:08 +00:00
11e73f56ec Accepting request 1006994 from home:yarunachalam:branches:devel:languages:python
- Update to 1.13 (2022-03-01)
  * Bundled Lua source files were missing in the source distribution.

OBS-URL: https://build.opensuse.org/request/show/1006994
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-lupa?expand=0&rev=19
2022-09-29 19:02:00 +00:00
5bbf54cb96 Accepting request 956623 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/956623
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-lupa?expand=0&rev=11
2022-02-23 15:25:42 +00:00
090354a569 Accepting request 956332 from home:gladiac:branches:devel:languages:python
- Fix BR for luajit (Leap 15.3 only offers moonjit)
- Skip building for python2

OBS-URL: https://build.opensuse.org/request/show/956332
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-lupa?expand=0&rev=18
2022-02-22 08:24:25 +00:00
a01bdc104d Accepting request 943002 from devel:languages:python
- Adjust BuildRequires for lua

OBS-URL: https://build.opensuse.org/request/show/943002
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-lupa?expand=0&rev=10
2021-12-30 14:55:26 +00:00
06ea211ba0 - Adjust BuildRequires for lua
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-lupa?expand=0&rev=17
2021-12-29 00:49:03 +00:00
caab9457d5 Accepting request 940346 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/940346
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-lupa?expand=0&rev=9
2021-12-16 20:19:32 +00:00
e92fdbda50 Accepting request 940098 from home:bnavigator:python-rpm-macros
- Update to 1.10
  * GH#147: Lua 5.4 is supported. (patch by Russel Davis)
  * The runtime version of the Lua library as a tuple (e.g. (5,3))
    is provided via lupa.LUA_VERSION and LuaRuntime.lua_version.
  * The Lua implementation name and version string is provided as
    LuaRuntime.lua_implementation.
  * setup.py accepts new command line arguments --lua-lib and
    --lua-includes to specify the
  * Use Lua 5.4.3 in binary wheels and as bundled Lua.
  * Built with Cython 0.29.24 to support Python 3.9.
- Also successfully builds and tests on python310
- Update to pkgconfig(lua5.4)

OBS-URL: https://build.opensuse.org/request/show/940098
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-lupa?expand=0&rev=16
2021-12-13 18:46:23 +00:00
d8f4df0a76 Accepting request 903562 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/903562
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-lupa?expand=0&rev=8
2021-07-10 20:53:54 +00:00
a14f881499 Accepting request 903471 from openSUSE:Factory:RISCV
- Force use of lua5.1, lua5.4 is not supported

OBS-URL: https://build.opensuse.org/request/show/903471
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-lupa?expand=0&rev=15
2021-07-01 17:14:10 +00:00
a5d758c1f0 Accepting request 895337 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/895337
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-lupa?expand=0&rev=7
2021-06-01 08:33:00 +00:00
6c785709b3 Accepting request 895319 from home:pgajdos:python
- %check: use %pyunittest_arch rpm macro

OBS-URL: https://build.opensuse.org/request/show/895319
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-lupa?expand=0&rev=13
2021-05-25 11:16:17 +00:00
bdb6dea808 Accepting request 861403 from devel:languages:python
- Remove third-party/ bundled application, use the system ones
  (bsc#1167557).

OBS-URL: https://build.opensuse.org/request/show/861403
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-lupa?expand=0&rev=6
2021-01-11 16:08:08 +00:00
714ad1e1e1 - Remove third-party/ bundled application, use the system ones
(bsc#1167557).

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-lupa?expand=0&rev=11
2021-01-07 16:31:33 +00:00
9261ddb902 Accepting request 787215 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/787215
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-lupa?expand=0&rev=5
2020-03-26 23:28:15 +00:00
Tomáš Chvátal
2090470374 Accepting request 787170 from openSUSE:Factory:RISCV
- No LuaJIT on riscv64

OBS-URL: https://build.opensuse.org/request/show/787170
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-lupa?expand=0&rev=9
2020-03-22 07:43:39 +00:00
4412c076dc Accepting request 781871 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/781871
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-lupa?expand=0&rev=4
2020-03-08 21:22:26 +00:00
Tomáš Chvátal
c91752763d Accepting request 781868 from home:pgajdos:python
- version update to 1.9
  * Build against Lua 5.3 if available.
  * GH#129: Fix Lua module loading in Python 3.x.
  * GH#126: Fix build on Linux systems that install Lua as "lua52" package.

OBS-URL: https://build.opensuse.org/request/show/781868
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-lupa?expand=0&rev=7
2020-03-05 14:02:24 +00:00
1d540edf7b Accepting request 757623 from devel:languages:python
Automatic submission by obs-autosubmit

OBS-URL: https://build.opensuse.org/request/show/757623
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-lupa?expand=0&rev=3
2019-12-23 21:38:39 +00:00
90ca99bd8c Accepting request 755513 from devel:languages:python
- Fix dependency on the luajit to pull any implementation

OBS-URL: https://build.opensuse.org/request/show/755513
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-lupa?expand=0&rev=2
2019-12-11 11:04:16 +00:00
0ec79ea76d - Use pkgconf instead of directly defining required development
packages.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-lupa?expand=0&rev=4
2019-12-10 20:17:42 +00:00
Tomáš Chvátal
7cb343399c - Fix dependency on the luajit to pull any implementation
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-lupa?expand=0&rev=3
2019-12-10 10:34:18 +00:00
67a912dea4 Accepting request 677348 from devel:languages:python
- Initial spec for v1.8

OBS-URL: https://build.opensuse.org/request/show/677348
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-lupa?expand=0&rev=1
2019-02-27 16:28:40 +00:00
77604d5d8f Accepting request 677289 from home:jayvdb:django
- Initial spec for v1.8

OBS-URL: https://build.opensuse.org/request/show/677289
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-lupa?expand=0&rev=1
2019-02-19 12:13:26 +00:00
3 changed files with 0 additions and 440 deletions

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ad3fef486be7adddd349fe9a9c393789061312cf98ebc533b489be34f484cb79
size 6278066

View File

@@ -1,19 +0,0 @@
Index: lupa-2.0/setup.py
===================================================================
--- lupa-2.0.orig/setup.py
+++ lupa-2.0/setup.py
@@ -365,10 +365,11 @@ if not configs and not option_no_bundle:
or (get_machine() != "x86_64" and 'luajit' in os.path.basename(lua_bundle_path.rstrip(os.sep)))
)
]
-if not configs and not option_use_bundle:
- configs = find_lua_build(no_luajit=option_no_luajit)
if not configs:
- configs = no_lua_error()
+ configs = [
+ (find_lua_build(no_luajit=option_no_luajit) if not option_use_bundle else {})
+ or no_lua_error()
+ ]
# check if Cython is installed, and use it if requested or necessary

View File

@@ -1,418 +0,0 @@
Index: lupa-2.0/lupa/_lupa.pyx
===================================================================
--- lupa-2.0.orig/lupa/_lupa.pyx
+++ lupa-2.0/lupa/_lupa.pyx
@@ -685,7 +685,7 @@ cdef int check_lua_stack(lua_State* L, i
return 0
-cdef int get_object_length_from_lua(lua_State* L) nogil:
+cdef int get_object_length_from_lua(lua_State* L) noexcept nogil:
cdef size_t length = lua.lua_objlen(L, lua.lua_upvalueindex(1))
lua.lua_pushlightuserdata(L, <void*>length)
return 1
@@ -789,10 +789,10 @@ cdef tuple _fix_args_kwargs(tuple args):
################################################################################
# fast, re-entrant runtime locking
-cdef inline bint lock_runtime(LuaRuntime runtime) with gil:
+cdef inline bint lock_runtime(LuaRuntime runtime) noexcept with gil:
return lock_lock(runtime._lock, pythread.PyThread_get_thread_ident(), True)
-cdef inline void unlock_runtime(LuaRuntime runtime) nogil:
+cdef inline void unlock_runtime(LuaRuntime runtime) noexcept nogil:
unlock_lock(runtime._lock)
@@ -967,7 +967,7 @@ cdef _LuaObject new_lua_object(LuaRuntim
init_lua_object(obj, runtime, L, n)
return obj
-cdef void init_lua_object(_LuaObject obj, LuaRuntime runtime, lua_State* L, int n):
+cdef void init_lua_object(_LuaObject obj, LuaRuntime runtime, lua_State* L, int n) noexcept:
obj._runtime = runtime
obj._state = L
lua.lua_pushvalue(L, n)
@@ -1353,7 +1353,7 @@ cdef class _LuaIter:
# type conversions and protocol adaptations
-cdef int py_asfunc_call(lua_State *L) nogil:
+cdef int py_asfunc_call(lua_State *L) noexcept nogil:
if (lua.lua_gettop(L) == 1 and lua.lua_islightuserdata(L, 1)
and lua.lua_topointer(L, 1) == <void*>unpack_wrapped_pyfunction):
# special case: unpack_python_argument_or_jump() calls this to find out the Python object
@@ -1363,7 +1363,7 @@ cdef int py_asfunc_call(lua_State *L) no
lua.lua_insert(L, 1)
return py_object_call(L)
-cdef py_object* unpack_wrapped_pyfunction(lua_State* L, int n) nogil:
+cdef py_object* unpack_wrapped_pyfunction(lua_State* L, int n) noexcept nogil:
cdef lua.lua_CFunction cfunction = lua.lua_tocfunction(L, n)
if cfunction is <lua.lua_CFunction>py_asfunc_call:
lua.lua_pushvalue(L, n)
@@ -1458,7 +1458,7 @@ cdef object py_from_lua(LuaRuntime runti
return new_lua_function(runtime, L, n)
return new_lua_object(runtime, L, n)
-cdef py_object* unpack_userdata(lua_State *L, int n) nogil:
+cdef py_object* unpack_userdata(lua_State *L, int n) noexcept nogil:
"""
Like luaL_checkudata(), unpacks a userdata object and validates that
it's a wrapped Python object. Returns NULL on failure.
@@ -1627,7 +1627,7 @@ cdef bint py_to_lua_custom(LuaRuntime ru
return 1 # values pushed
-cdef inline int _isascii(unsigned char* s):
+cdef inline int _isascii(unsigned char* s) noexcept:
cdef unsigned char c = 0
while s[0]:
c |= s[0]
@@ -1663,7 +1663,7 @@ cdef int raise_lua_error(LuaRuntime runt
raise LuaError(error_message)
-cdef bint _looks_like_traceback_line(unicode line):
+cdef bint _looks_like_traceback_line(unicode line) except -1:
# Lua tracebacks look like this (using tabs as indentation):
# stack traceback:
# [C]: in function 'error'
@@ -1825,7 +1825,7 @@ cdef tuple unpack_multiple_lua_results(L
# bounded memory allocation
-cdef void* _lua_alloc_restricted(void* ud, void* ptr, size_t old_size, size_t new_size) nogil:
+cdef void* _lua_alloc_restricted(void* ud, void* ptr, size_t old_size, size_t new_size) noexcept nogil:
# adapted from https://stackoverflow.com/a/9672205
# print(<size_t>ud, <size_t>ptr, old_size, new_size)
cdef MemoryStatus* memory_status = <MemoryStatus*>ud
@@ -1855,7 +1855,7 @@ cdef void* _lua_alloc_restricted(void* u
memory_status.used += new_size - old_size
return new_ptr
-cdef int _lua_panic(lua_State *L) nogil:
+cdef int _lua_panic(lua_State *L) noexcept nogil:
cdef const char* msg = lua.lua_tostring(L, -1)
if msg == NULL:
msg = "error object is not a string"
@@ -1896,7 +1896,7 @@ cdef class _PyReference:
cdef int _ref
-cdef int py_object_gc_with_gil(py_object *py_obj, lua_State* L) with gil:
+cdef int py_object_gc_with_gil(py_object *py_obj, lua_State* L) noexcept with gil:
cdef _PyReference pyref
# originally, we just used:
#cpython.ref.Py_XDECREF(py_obj.obj)
@@ -1917,7 +1917,7 @@ cdef int py_object_gc_with_gil(py_object
finally:
py_obj.obj = NULL
-cdef int py_object_gc(lua_State* L) nogil:
+cdef int py_object_gc(lua_State* L) noexcept nogil:
if not lua.lua_isuserdata(L, 1):
return 0
py_obj = unpack_userdata(L, 1)
@@ -1968,7 +1968,7 @@ cdef bint call_python(LuaRuntime runtime
return py_function_result_to_lua(runtime, L, result)
-cdef int py_call_with_gil(lua_State* L, py_object *py_obj) with gil:
+cdef int py_call_with_gil(lua_State* L, py_object *py_obj) noexcept with gil:
cdef LuaRuntime runtime = None
cdef lua_State* stored_state = NULL
@@ -1985,7 +1985,7 @@ cdef int py_call_with_gil(lua_State* L,
if stored_state is not NULL:
runtime._state = stored_state
-cdef int py_object_call(lua_State* L) nogil:
+cdef int py_object_call(lua_State* L) noexcept nogil:
cdef py_object* py_obj = unpack_python_argument_or_jump(L, 1) # may not return on error!
result = py_call_with_gil(L, py_obj)
if result < 0:
@@ -1994,7 +1994,7 @@ cdef int py_object_call(lua_State* L) no
# str() support for Python objects
-cdef int py_str_with_gil(lua_State* L, py_object* py_obj) with gil:
+cdef int py_str_with_gil(lua_State* L, py_object* py_obj) noexcept with gil:
cdef LuaRuntime runtime
try:
runtime = <LuaRuntime?>py_obj.runtime
@@ -2012,7 +2012,7 @@ cdef int py_str_with_gil(lua_State* L, p
try: runtime.store_raised_exception(L, b'error during Python str() call')
finally: return -1
-cdef int py_object_str(lua_State* L) nogil:
+cdef int py_object_str(lua_State* L) noexcept nogil:
cdef py_object* py_obj = unpack_python_argument_or_jump(L, 1) # may not return on error!
result = py_str_with_gil(L, py_obj)
if result < 0:
@@ -2072,7 +2072,7 @@ cdef int setattr_for_lua(LuaRuntime runt
return 0
-cdef int py_object_getindex_with_gil(lua_State* L, py_object* py_obj) with gil:
+cdef int py_object_getindex_with_gil(lua_State* L, py_object* py_obj) noexcept with gil:
cdef LuaRuntime runtime
try:
runtime = <LuaRuntime?>py_obj.runtime
@@ -2084,7 +2084,7 @@ cdef int py_object_getindex_with_gil(lua
try: runtime.store_raised_exception(L, b'error reading Python attribute/item')
finally: return -1
-cdef int py_object_getindex(lua_State* L) nogil:
+cdef int py_object_getindex(lua_State* L) noexcept nogil:
cdef py_object* py_obj = unpack_python_argument_or_jump(L, 1) # may not return on error!
result = py_object_getindex_with_gil(L, py_obj)
if result < 0:
@@ -2092,7 +2092,7 @@ cdef int py_object_getindex(lua_State* L
return result
-cdef int py_object_setindex_with_gil(lua_State* L, py_object* py_obj) with gil:
+cdef int py_object_setindex_with_gil(lua_State* L, py_object* py_obj) noexcept with gil:
cdef LuaRuntime runtime
try:
runtime = <LuaRuntime?>py_obj.runtime
@@ -2104,7 +2104,7 @@ cdef int py_object_setindex_with_gil(lua
try: runtime.store_raised_exception(L, b'error writing Python attribute/item')
finally: return -1
-cdef int py_object_setindex(lua_State* L) nogil:
+cdef int py_object_setindex(lua_State* L) noexcept nogil:
cdef py_object* py_obj = unpack_python_argument_or_jump(L, 1) # may not return on error!
result = py_object_setindex_with_gil(L, py_obj)
if result < 0:
@@ -2124,12 +2124,12 @@ cdef lua.luaL_Reg *py_object_lib = [
## # Python helper functions for Lua
-cdef inline py_object* unpack_single_python_argument_or_jump(lua_State* L) nogil:
+cdef inline py_object* unpack_single_python_argument_or_jump(lua_State* L) noexcept nogil:
if lua.lua_gettop(L) > 1:
lua.luaL_argerror(L, 2, "invalid arguments") # never returns!
return unpack_python_argument_or_jump(L, 1)
-cdef inline py_object* unpack_python_argument_or_jump(lua_State* L, int n) nogil:
+cdef inline py_object* unpack_python_argument_or_jump(lua_State* L, int n) noexcept nogil:
cdef py_object* py_obj
if lua.lua_isuserdata(L, n):
@@ -2144,7 +2144,7 @@ cdef inline py_object* unpack_python_arg
return py_obj
-cdef int py_wrap_object_protocol_with_gil(lua_State* L, py_object* py_obj, int type_flags) with gil:
+cdef int py_wrap_object_protocol_with_gil(lua_State* L, py_object* py_obj, int type_flags) noexcept with gil:
cdef LuaRuntime runtime
try:
runtime = <LuaRuntime?>py_obj.runtime
@@ -2153,41 +2153,41 @@ cdef int py_wrap_object_protocol_with_gi
try: runtime.store_raised_exception(L, b'error during type adaptation')
finally: return -1
-cdef int py_wrap_object_protocol(lua_State* L, int type_flags) nogil:
+cdef int py_wrap_object_protocol(lua_State* L, int type_flags) noexcept nogil:
cdef py_object* py_obj = unpack_single_python_argument_or_jump(L) # never returns on error!
result = py_wrap_object_protocol_with_gil(L, py_obj, type_flags)
if result < 0:
return lua.lua_error(L) # never returns!
return result
-cdef int py_as_attrgetter(lua_State* L) nogil:
+cdef int py_as_attrgetter(lua_State* L) noexcept nogil:
return py_wrap_object_protocol(L, 0)
-cdef int py_as_itemgetter(lua_State* L) nogil:
+cdef int py_as_itemgetter(lua_State* L) noexcept nogil:
return py_wrap_object_protocol(L, OBJ_AS_INDEX)
-cdef int py_as_function(lua_State* L) nogil:
+cdef int py_as_function(lua_State* L) noexcept nogil:
cdef py_object* py_obj = unpack_single_python_argument_or_jump(L) # never returns on error!
lua.lua_pushcclosure(L, <lua.lua_CFunction>py_asfunc_call, 1)
return 1
# iteration support for Python objects in Lua
-cdef int py_iter(lua_State* L) nogil:
+cdef int py_iter(lua_State* L) noexcept nogil:
cdef py_object* py_obj = unpack_single_python_argument_or_jump(L) # never returns on error!
result = py_iter_with_gil(L, py_obj, 0)
if result < 0:
return lua.lua_error(L) # never returns!
return result
-cdef int py_iterex(lua_State* L) nogil:
+cdef int py_iterex(lua_State* L) noexcept nogil:
cdef py_object* py_obj = unpack_single_python_argument_or_jump(L) # never returns on error!
result = py_iter_with_gil(L, py_obj, OBJ_UNPACK_TUPLE)
if result < 0:
return lua.lua_error(L) # never returns!
return result
-cdef int convert_to_lua_Integer(lua_State* L, int idx, lua.lua_Integer* integer) nogil:
+cdef int convert_to_lua_Integer(lua_State* L, int idx, lua.lua_Integer* integer) noexcept nogil:
cdef int isnum
cdef lua.lua_Integer temp
temp = lua.lua_tointegerx(L, idx, &isnum)
@@ -2198,7 +2198,7 @@ cdef int convert_to_lua_Integer(lua_Stat
lua.lua_pushfstring(L, "Could not convert %s to string", lua.luaL_typename(L, idx))
return -1
-cdef int py_enumerate(lua_State* L) nogil:
+cdef int py_enumerate(lua_State* L) noexcept nogil:
if lua.lua_gettop(L) > 2:
lua.luaL_argerror(L, 3, "invalid arguments") # never returns!
cdef py_object* py_obj = unpack_python_argument_or_jump(L, 1)
@@ -2214,7 +2214,7 @@ cdef int py_enumerate(lua_State* L) nogi
return result
-cdef int py_enumerate_with_gil(lua_State* L, py_object* py_obj, lua.lua_Integer start) with gil:
+cdef int py_enumerate_with_gil(lua_State* L, py_object* py_obj, lua.lua_Integer start) noexcept with gil:
cdef LuaRuntime runtime
try:
runtime = <LuaRuntime?>py_obj.runtime
@@ -2224,7 +2224,7 @@ cdef int py_enumerate_with_gil(lua_State
try: runtime.store_raised_exception(L, b'error creating an iterator with enumerate()')
finally: return -1
-cdef int py_iter_with_gil(lua_State* L, py_object* py_obj, int type_flags) with gil:
+cdef int py_iter_with_gil(lua_State* L, py_object* py_obj, int type_flags) noexcept with gil:
cdef LuaRuntime runtime
try:
runtime = <LuaRuntime?>py_obj.runtime
@@ -2257,7 +2257,7 @@ cdef int py_push_iterator(LuaRuntime run
lua.lua_pushnil(L)
return 3
-cdef int py_iter_next(lua_State* L) nogil:
+cdef int py_iter_next(lua_State* L) noexcept nogil:
# first value in the C closure: the Python iterator object
cdef py_object* py_obj = unpack_python_argument_or_jump(L, 1) # may not return on error!
result = py_iter_next_with_gil(L, py_obj)
@@ -2265,7 +2265,7 @@ cdef int py_iter_next(lua_State* L) nogi
return lua.lua_error(L) # never returns!
return result
-cdef int py_iter_next_with_gil(lua_State* L, py_object* py_iter) with gil:
+cdef int py_iter_next_with_gil(lua_State* L, py_object* py_iter) noexcept with gil:
cdef LuaRuntime runtime
try:
runtime = <LuaRuntime?>py_iter.runtime
@@ -2302,7 +2302,7 @@ cdef class _PyArguments:
cdef tuple args
cdef dict kwargs
-cdef int py_args_with_gil(PyObject* runtime_obj, lua_State* L) with gil:
+cdef int py_args_with_gil(PyObject* runtime_obj, lua_State* L) noexcept with gil:
cdef _PyArguments pyargs
cdef LuaRuntime runtime
try:
@@ -2314,7 +2314,7 @@ cdef int py_args_with_gil(PyObject* runt
try: runtime.store_raised_exception(L, b'error while calling python.args()')
finally: return -1
-cdef int py_args(lua_State* L) nogil:
+cdef int py_args(lua_State* L) noexcept nogil:
cdef PyObject* runtime
runtime = <PyObject*>lua.lua_touserdata(L, lua.lua_upvalueindex(1))
if not runtime:
@@ -2327,7 +2327,7 @@ cdef int py_args(lua_State* L) nogil:
# overflow handler setter
-cdef int py_set_overflow_handler(lua_State* L) nogil:
+cdef int py_set_overflow_handler(lua_State* L) noexcept nogil:
if (not lua.lua_isnil(L, 1)
and not lua.lua_isfunction(L, 1)
and not unpack_python_argument_or_jump(L, 1)):
@@ -2352,7 +2352,7 @@ cdef lua.luaL_Reg *py_lib = [
# Setup helpers for library tables (removed from C-API in Lua 5.3).
-cdef void luaL_setfuncs(lua_State *L, const lua.luaL_Reg *l, int nup):
+cdef void luaL_setfuncs(lua_State *L, const lua.luaL_Reg *l, int nup) noexcept:
cdef int i
lua.luaL_checkstack(L, nup, "too many upvalues")
while l.name != NULL:
@@ -2364,7 +2364,7 @@ cdef void luaL_setfuncs(lua_State *L, co
lua.lua_pop(L, nup)
-cdef int libsize(const lua.luaL_Reg *l):
+cdef int libsize(const lua.luaL_Reg *l) noexcept:
cdef int size = 0
while l and l.name:
l += 1
@@ -2373,7 +2373,7 @@ cdef int libsize(const lua.luaL_Reg *l):
cdef const char *luaL_findtable(lua_State *L, int idx,
- const char *fname, int size_hint):
+ const char *fname, int size_hint) noexcept:
cdef const char *end
if idx:
lua.lua_pushvalue(L, idx)
@@ -2400,7 +2400,7 @@ cdef const char *luaL_findtable(lua_Stat
return NULL
-cdef void luaL_pushmodule(lua_State *L, const char *modname, int size_hint):
+cdef void luaL_pushmodule(lua_State *L, const char *modname, int size_hint) noexcept:
# XXX: "_LOADED" is the value of LUA_LOADED_TABLE,
# but it's absent in lua51
luaL_findtable(L, lua.LUA_REGISTRYINDEX, "_LOADED", 1)
@@ -2416,7 +2416,7 @@ cdef void luaL_pushmodule(lua_State *L,
cdef void luaL_openlib(lua_State *L, const char *libname,
- const lua.luaL_Reg *l, int nup):
+ const lua.luaL_Reg *l, int nup) noexcept:
if libname:
luaL_pushmodule(L, libname, libsize(l))
lua.lua_insert(L, -(nup + 1))
@@ -2427,7 +2427,7 @@ cdef void luaL_openlib(lua_State *L, con
# internal Lua functions meant to be called in protected mode
-cdef int get_from_lua_table(lua_State* L) nogil:
+cdef int get_from_lua_table(lua_State* L) noexcept nogil:
"""Equivalent to the following Lua function:
function(t, k) return t[k] end
"""
Index: lupa-2.0/lupa/lock.pxi
===================================================================
--- lupa-2.0.orig/lupa/lock.pxi
+++ lupa-2.0/lupa/lock.pxi
@@ -71,7 +71,7 @@ cdef class FastRLock:
return self._count > 0 and self._owner == pythread.PyThread_get_thread_ident()
-cdef inline bint lock_lock(FastRLock lock, pythread_t current_thread, bint blocking) nogil:
+cdef inline bint lock_lock(FastRLock lock, pythread_t current_thread, bint blocking) noexcept nogil:
# Note that this function *must* hold the GIL when being called.
# We just use 'nogil' in the signature to make sure that no Python
# code execution slips in that might free the GIL
@@ -91,7 +91,7 @@ cdef inline bint lock_lock(FastRLock loc
lock, current_thread,
pythread.WAIT_LOCK if blocking else pythread.NOWAIT_LOCK)
-cdef bint _acquire_lock(FastRLock lock, pythread_t current_thread, int wait) nogil:
+cdef bint _acquire_lock(FastRLock lock, pythread_t current_thread, int wait) noexcept nogil:
# Note that this function *must* hold the GIL when being called.
# We just use 'nogil' in the signature to make sure that no Python
# code execution slips in that might free the GIL
@@ -119,7 +119,7 @@ cdef bint _acquire_lock(FastRLock lock,
lock._count = 1
return 1
-cdef inline void unlock_lock(FastRLock lock) nogil:
+cdef inline void unlock_lock(FastRLock lock) noexcept nogil:
# Note that this function *must* hold the GIL when being called.
# We just use 'nogil' in the signature to make sure that no Python
# code execution slips in that might free the GIL