mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 13:04:51 -04:00
Consistently use collections.abc.Mapping to check frozendict. (#12564)
This commit is contained in:
parent
e8d1ec0e92
commit
8a23bde823
5 changed files with 11 additions and 9 deletions
|
@ -11,6 +11,7 @@
|
|||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
import collections.abc
|
||||
from typing import Any
|
||||
|
||||
from frozendict import frozendict
|
||||
|
@ -35,7 +36,7 @@ def freeze(o: Any) -> Any:
|
|||
|
||||
|
||||
def unfreeze(o: Any) -> Any:
|
||||
if isinstance(o, (dict, frozendict)):
|
||||
if isinstance(o, collections.abc.Mapping):
|
||||
return {k: unfreeze(v) for k, v in o.items()}
|
||||
|
||||
if isinstance(o, (bytes, str)):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue