File tree Expand file tree Collapse file tree 5 files changed +20
-13
lines changed
Expand file tree Collapse file tree 5 files changed +20
-13
lines changed Original file line number Diff line number Diff line change @@ -11,18 +11,19 @@ lint: \
1111 doc8 \
1212 flake8 \
1313 isort \
14- linkcheck \
1514 mypy \
1615 pip-extra-reqs \
1716 pip-missing-reqs \
1817 pyroma \
1918 shellcheck \
20- spelling \
2119 vulture \
2220 pylint \
2321 pydocstyle \
2422 yapf
2523
24+ # TODO add stuff back
25+ # spelling, linkcheck
26+ #
2627.PHONY : fix-lint
2728fix-lint :
2829 # Move imports to a single line so that autoflake can handle them.
Original file line number Diff line number Diff line change @@ -2,4 +2,4 @@ VWS-Auth-Tools==2019.12.28.3
22requests == 2.23.0
33wrapt-timeout-decorator == 1.3.1
44urllib3 == 1.25.8
5- dill == 0.2.9
5+ func-timeout == 4.3.5
Original file line number Diff line number Diff line change 88from typing import Optional
99
1010from wrapt_timeout_decorator import timeout
11+ from func_timeout import func_set_timeout
1112
1213import vws
1314from vws .exceptions import TargetProcessingTimeout
@@ -58,10 +59,9 @@ def foobar(
5859 Add Windows support.
5960 """
6061
61- @timeout (
62- dec_timeout = timeout_seconds ,
63- timeout_exception = TargetProcessingTimeout ,
64- use_signals = False ,
62+ @func_set_timeout (
63+ timeout = timeout_seconds ,
64+ # timeout_exception=TargetProcessingTimeout,
6565 )
6666 def decorated () -> None :
6767 _wait_for_target_processed (
Original file line number Diff line number Diff line change 22Custom exceptions for Vuforia errors.
33"""
44
5+ from func_timeout .exceptions import FunctionTimedOut
56import json
67from urllib .parse import urlparse
78
Original file line number Diff line number Diff line change 1313from requests import Response
1414from vws_auth_tools import authorization_header , rfc_1123_date
1515
16+ from func_timeout .exceptions import FunctionTimedOut
17+ from vws .exceptions import TargetProcessingTimeout
1618from vws ._result_codes import raise_for_result_code
1719from vws ._wait_for_target_processed import foobar
1820from vws .reports import (
@@ -286,12 +288,15 @@ def wait_for_target_processed(
286288 ~vws.exceptions.RequestTimeTooSkewed: There is an error with the
287289 time sent to Vuforia.
288290 """
289- foobar (
290- vws_client = self ,
291- target_id = target_id ,
292- timeout_seconds = timeout_seconds ,
293- seconds_between_requests = seconds_between_requests ,
294- )
291+ try :
292+ foobar (
293+ vws_client = self ,
294+ target_id = target_id ,
295+ timeout_seconds = timeout_seconds ,
296+ seconds_between_requests = seconds_between_requests ,
297+ )
298+ except FunctionTimedOut :
299+ raise TargetProcessingTimeout
295300
296301 def list_targets (self ) -> List [str ]:
297302 """
You can’t perform that action at this time.
0 commit comments