Skip to content
Open
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
2 changes: 1 addition & 1 deletion a_sync/a_sync/_flags.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ You can use any of the provided flags, whichever makes the most sense for your u
"""

from a_sync.a_sync.flags cimport AFFIRMATIVE_FLAGS, NEGATIVE_FLAGS
from a_sync.exceptions import InvalidFlag, InvalidFlagValue
from a_sync.exceptions cimport InvalidFlag, InvalidFlagValue


cdef inline bint negate_if_necessary(str flag, bint flag_value):
Expand Down
8 changes: 1 addition & 7 deletions a_sync/a_sync/_helpers.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ and converting synchronous functions to asynchronous ones.
import asyncio
from asyncio.futures import _chain_future

from a_sync import exceptions
from a_sync._typing import P, T
from a_sync.exceptions cimport FunctionNotSync, SyncModeInAsyncContextError
from a_sync.functools cimport wraps

# cdef asyncio
Expand All @@ -18,12 +18,6 @@ cdef object _get_event_loop = asyncio.get_event_loop
del asyncio


# cdef exceptions
cdef object FunctionNotSync = exceptions.FunctionNotSync
cdef object SyncModeInAsyncContextError = exceptions.SyncModeInAsyncContextError
del exceptions


cpdef object get_event_loop():
cdef object loop
try:
Expand Down
2 changes: 1 addition & 1 deletion a_sync/a_sync/_kwargs.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
This module provides utility functions for handling keyword arguments related to synchronous and asynchronous flags.
"""

from a_sync import exceptions
from a_sync.a_sync._flags cimport validate_and_negate_if_necessary
from a_sync.a_sync.flags cimport VIABLE_FLAGS
from a_sync.exceptions cimport TooManyFlags

# cdef exceptions
cdef object TooManyFlags = exceptions.TooManyFlags
Expand Down
8 changes: 7 additions & 1 deletion a_sync/a_sync/base.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ from a_sync._typing import *
from a_sync.a_sync._flags cimport validate_and_negate_if_necessary, validate_flag_value
from a_sync.a_sync.abstract import ASyncABC
from a_sync.a_sync.flags cimport VIABLE_FLAGS
from a_sync.exceptions import ASyncFlagException, FlagNotDefined, InvalidFlag, NoFlagsFound, TooManyFlags
from a_sync.exceptions cimport (
ASyncFlagException,
FlagNotDefined,
InvalidFlag,
NoFlagsFound,
TooManyFlags,
)
from a_sync.functools cimport cached_property_unsafe


Expand Down
5 changes: 1 addition & 4 deletions a_sync/asyncio/create_task.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import typing

from a_sync import _smart, exceptions
from a_sync._typing import T
from a_sync.exceptions cimport PersistedTaskException


# cdef asyncio
Expand Down Expand Up @@ -37,10 +38,6 @@ cdef object SmartTask = _smart.SmartTask
cdef object smart_task_factory = _smart.smart_task_factory
del _smart

# cdef exceptions
cdef object PersistedTaskException = exceptions.PersistedTaskException
del exceptions


def create_task(
coro: Awaitable[T],
Expand Down
9 changes: 9 additions & 0 deletions a_sync/exceptions.pxd
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
cdef public object ASyncFlagException
cdef public object NoFlagsFound
cdef public object TooManyFlags
cdef public object InvalidFlag
cdef public object InvalidFlagValue
cdef public object FlagNotDefined
cdef public object FunctionNotSync
cdef public object SyncModeInAsyncContextError
cdef public object PersistedTaskException
2 changes: 1 addition & 1 deletion a_sync/iter.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ from a_sync.a_sync._helpers cimport _await
from a_sync.async_property import async_cached_property
from a_sync.async_property.cached cimport AsyncCachedPropertyInstanceState
from a_sync.asyncio cimport cigather, ccreate_task_simple
from a_sync.exceptions import SyncModeInAsyncContextError
from a_sync.exceptions cimport SyncModeInAsyncContextError
from a_sync.functools cimport update_wrapper


Expand Down
Loading