From cbe6716afde4696bc1c31dec36332db47cd89f93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20L=C3=B3pez?= Date: Mon, 26 Jun 2023 18:53:43 -0300 Subject: [PATCH] Fix execution in Python 3.11 This fixes the following error: ValueError: mutable default for field src is not allowed: use default_factory --- slither/utils/loc.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/slither/utils/loc.py b/slither/utils/loc.py index 0e51dfa46..dde91578b 100644 --- a/slither/utils/loc.py +++ b/slither/utils/loc.py @@ -1,4 +1,4 @@ -from dataclasses import dataclass +from dataclasses import dataclass, field from pathlib import Path from typing import List, Tuple @@ -19,9 +19,9 @@ class LoCInfo: @dataclass class LoC: - src: LoCInfo = LoCInfo() - dep: LoCInfo = LoCInfo() - test: LoCInfo = LoCInfo() + src: LoCInfo = field(default_factory=LoCInfo) + dep: LoCInfo = field(default_factory=LoCInfo) + test: LoCInfo = field(default_factory=LoCInfo) def to_pretty_table(self) -> MyPrettyTable: table = MyPrettyTable(["", "src", "dep", "test"])