File tree 1 file changed +13
-2
lines changed
1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 5
5
from typing import Tuple , Optional
6
6
from pathlib import Path
7
7
import os
8
- from functools import cache
8
+ import sys
9
+
9
10
10
11
import boto3
11
12
from moto import mock_aws
12
13
from lambda_multiprocessing .timeout import TimeoutManager , TestTimeoutException
13
14
15
+ if sys .version_info < (3 , 9 ):
16
+ # functools.cache was added in 3.9
17
+ # define an empty decorator that doesn't do anything
18
+ # (our usage of the cache isn't essential)
19
+ def cache (func ):
20
+ return func
21
+ else :
22
+ # Import the cache function from functools for Python 3.9 and above
23
+ from functools import cache
24
+
14
25
# add an overhead for duration when asserting the duration of child processes
15
26
# if other processes are hogging CPU, make this bigger
16
27
delta = 0.1
@@ -39,7 +50,7 @@ def return_with_sleep(x, delay=0.3):
39
50
40
51
def _raise (ex : Optional [Exception ]):
41
52
if ex :
42
- raise exfrom . timeout
53
+ raise ex
43
54
44
55
class ExceptionA (Exception ):
45
56
pass
You can’t perform that action at this time.
0 commit comments