Skip to content

Commit

Permalink
feat: Add exception types to Pynisher class
Browse files Browse the repository at this point in the history
  • Loading branch information
eddiebergman committed Mar 19, 2023
1 parent 70f5a4c commit 2c0879d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions pynisher/pynisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ class _EMPTY:
class Pynisher(Generic[P, T]):
"""Restrict a function's resources"""

WallTimeoutException = WallTimeoutException
CpuTimeoutException = CpuTimeoutException
MemoryLimitException = MemoryLimitException
PynisherException = PynisherException
TimeoutException = WallTimeoutException

# If `raises=True` or left as default, the return type when calling is just T
@overload
def __init__(
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

setup(
name="pynisher",
version="1.0.2",
version="1.0.3",
packages=find_packages(where=".", include=["pynisher*"], exclude=["test*"]),
include_package_data=True,
install_requires=[
Expand Down

0 comments on commit 2c0879d

Please sign in to comment.