Skip to content

Commit

Permalink
Add wraps helper to the decorator.
Browse files Browse the repository at this point in the history
  • Loading branch information
denpamusic committed Oct 20, 2023
1 parent 7cabb39 commit a425a52
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pyplumio/helpers/timeout.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from __future__ import annotations

import asyncio
from functools import wraps
import logging

_LOGGER = logging.getLogger(__name__)
Expand All @@ -14,6 +15,7 @@ def timeout(seconds: int, raise_exception: bool = True):
"""

def decorator(func):
@wraps(func)
async def wrapper(*args, **kwargs):
try:
return await asyncio.wait_for(func(*args, **kwargs), timeout=seconds)
Expand Down

0 comments on commit a425a52

Please sign in to comment.