Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All hail black!! #29

Merged
merged 1 commit into from
Jan 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 25 additions & 10 deletions src/pointers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,43 @@
from ._utils import force_set_attr
from .api_bindings import *
from .base_pointers import (
BaseAllocatedPointer, BaseCPointer, BaseObjectPointer, BasePointer,
BasicPointer, Dereferencable, IterDereferencable, Sized, Typed
BaseAllocatedPointer,
BaseCPointer,
BaseObjectPointer,
BasePointer,
BasicPointer,
Dereferencable,
IterDereferencable,
Sized,
Typed,
)
from .bindings import *
from .c_pointer import (
TypedCPointer, VoidPointer, array, cast, to_c_ptr, to_func_ptr,
to_struct_ptr, to_voidp
TypedCPointer,
VoidPointer,
array,
cast,
to_c_ptr,
to_func_ptr,
to_struct_ptr,
to_voidp,
)
from .calloc import AllocatedArrayPointer, calloc
from .custom_binding import binding, binds
from .decay import decay, decay_annotated, decay_wrapped
from .exceptions import (
AllocationError, DereferenceError, FreedMemoryError,
InvalidBindingParameter, InvalidSizeError, NullPointerError,
SegmentViolation
AllocationError,
DereferenceError,
FreedMemoryError,
InvalidBindingParameter,
InvalidSizeError,
NullPointerError,
SegmentViolation,
)
from .magic import _
from .malloc import AllocatedPointer, free, malloc, realloc
from .object_pointer import Pointer, to_ptr
from .stack_pointer import (
StackAllocatedPointer, acquire_stack_alloc, stack_alloc
)
from .stack_pointer import StackAllocatedPointer, acquire_stack_alloc, stack_alloc
from .std_structs import DivT, Lconv, LDivT, Tm
from .structure import Struct, StructPointer
from .util import NULL, Nullable, handle, raw_type, struct_cast
Expand Down
8 changes: 5 additions & 3 deletions src/pointers/_cstd.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@
_c_library_name = find_library("c") or "libc.so.6"

dll = ctypes.CDLL(_c_library_name)
mdll = dll if platform in ("win32", "cygwin") else ctypes.CDLL(
find_library("m") or (
"libm.dylib" if platform == "darwin" else "libm.so.6"
mdll = (
dll
if platform in ("win32", "cygwin")
else ctypes.CDLL(
find_library("m") or ("libm.dylib" if platform == "darwin" else "libm.so.6")
)
)

Expand Down
Loading