Skip to content

Commit 6c3026d

Browse files
committed
Merge branch 'UltraStudioLTD-master'
2 parents d9c6527 + 9c48624 commit 6c3026d

13 files changed

+3279
-680
lines changed

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ classifiers = [
2323
dependencies = [
2424
"typing_extensions",
2525
]
26-
version = "2.2.0"
26+
version = "2.3.0-alpha"
2727

2828
[project.urls]
2929
Documentation = "https://pointers.zintensity.dev"

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
if __name__ == "__main__":
77
setup(
88
name="pointers.py",
9-
version="2.2.0",
9+
version="2.3.0-alpha",
1010
packages=["pointers"],
1111
license="MIT",
1212
project_urls={

src/_pointers.pyi

+3
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@ from typing import Any, Callable, TypeVar
22

33
_T = TypeVar("_T")
44

5+
56
def add_ref(obj: Any) -> None: ...
67
def remove_ref(obj: Any) -> None: ...
78
def force_set_attr(typ: type[Any], key: str, value: Any) -> None: ...
89
def set_ref(obj: Any, count: int) -> None: ...
10+
11+
912
def handle(
1013
func: Callable[..., _T],
1114
args: tuple[Any, ...] | None = None,

src/mod.c

-4
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@
1414
#include <stdio.h>
1515
#include <frameobject.h> // needed to get members of PyFrameObject
1616
#define GETOBJ PyObject* obj; if (!PyArg_ParseTuple(args, "O", &obj)) return NULL
17-
#define INIT_HANDLER(sig, handle, msg) if (signal(sig, handle) == SIG_ERR) { \
18-
PyErr_SetString(PyExc_ImportError, msg); \
19-
return NULL; \
20-
}
2117

2218
static jmp_buf buf;
2319

src/pointers/_cstd.py

+11-8
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
import ctypes
22
from ctypes.util import find_library
3-
from platform import system
4-
5-
platforms = {
6-
"linux": "libc.so.6",
7-
"darwin": "libc.dylib",
8-
"windows": "msvcrt",
9-
}
3+
from sys import platform
104

115
__all__ = (
126
"c_malloc",
@@ -20,7 +14,16 @@
2014
"ldiv_t",
2115
)
2216

23-
dll = ctypes.CDLL(platforms.get(system().lower()) or find_library("c"))
17+
_c_library_name: str
18+
19+
if platform in ("win32", "cygwin"):
20+
_c_library_name = "msvcrt"
21+
elif platform == "darwin":
22+
_c_library_name = "libc.dylib"
23+
else:
24+
_c_library_name = find_library("c") or "libc.so.6"
25+
26+
dll = ctypes.CDLL(_c_library_name)
2427

2528

2629
class tm(ctypes.Structure):

0 commit comments

Comments
 (0)