blob: 41bd7bc2712b59ff00afde4791db0d5534ca92ce (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
From 57d024e4ce2516c55c715448296b9099db68343c Mon Sep 17 00:00:00 2001
From: Karthikeyan Singaravelan <tir.karthi@gmail.com>
Date: Fri, 7 May 2021 15:51:33 +0000
Subject: [PATCH] Fix decorate_class for Python 3.10 where staticmethod is
callable.
(edited by mgorny for more readable indent)
---
freezegun/api.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/freezegun/api.py b/freezegun/api.py
index cab9ebe..eb3a931 100644
--- a/freezegun/api.py
+++ b/freezegun/api.py
@@ -598,7 +598,10 @@ class _freeze_time(object):
continue
seen.add(attr)
- if not callable(attr_value) or inspect.isclass(attr_value):
+ # staticmethods are callable from Python 3.10 . Hence skip them from decoration
+ if (not callable(attr_value)
+ or inspect.isclass(attr_value)
+ or isinstance(attr_value, staticmethod)):
continue
try:
--
2.31.1
|