Skip to content

Commit 46a8155

Browse files
committed
chore: convert fs objects to meta.Immutable
Signed-off-by: Brian Harring <ferringb@gmail.com>
1 parent e7cc71e commit 46a8155

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/pkgcore/fs/fs.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from snakeoil.compatibility import cmp
1313
from snakeoil.currying import post_curry, pretty_docs
1414
from snakeoil.data_source import local_source
15+
from snakeoil.klass import immutable
1516
from snakeoil.mappings import LazyFullValLoadDict
1617
from snakeoil.osutils import normpath, pjoin
1718

@@ -49,7 +50,7 @@ def gen_doc_additions(init, slots):
4950
)
5051

5152

52-
class fsBase:
53+
class fsBase(immutable.Simple):
5354
"""base class, all extensions must derive from this class"""
5455

5556
__slots__ = ("location", "mtime", "mode", "uid", "gid")
@@ -63,18 +64,16 @@ class fsBase:
6364
)
6465

6566
klass.inject_richcmp_methods_from_cmp(locals())
66-
klass.inject_immutable_instance(locals())
6767

6868
def __init__(self, location, strict=True, **d):
6969
d["location"] = normpath(location)
7070

71-
s = object.__setattr__
7271
if strict:
7372
for k in self.__attrs__:
74-
s(self, k, d[k])
73+
object.__setattr__(self, k, d[k])
7574
else:
7675
for k, v in d.items():
77-
s(self, k, v)
76+
object.__setattr__(self, k, v)
7877

7978
gen_doc_additions(__init__, __attrs__)
8079

0 commit comments

Comments
 (0)