Python code modernization, 3/n (#1157)

* Remove __metaclass__ = type.

for i in $(grep -REl '__metaclass__ = type' plugins/ tests/); do
  sed -e '/^__metaclass__ = type/d' -i $i;
done

* Remove super arguments, and stop inheriting from object.
This commit is contained in:
Felix Fontein
2025-10-10 08:11:58 +02:00
committed by GitHub
parent 741c318b1d
commit e8ec22d3b1
99 changed files with 129 additions and 245 deletions
+2 -2
View File
@@ -158,7 +158,7 @@ def walk(root, patterns, default=True):
# Heavily based on
# https://github.com/moby/moby/blob/master/pkg/fileutils/fileutils.go
class PatternMatcher(object):
class PatternMatcher:
def __init__(self, patterns):
self.patterns = list(filter(lambda p: p.dirs, [Pattern(p) for p in patterns]))
self.patterns.append(Pattern("!.dockerignore"))
@@ -216,7 +216,7 @@ class PatternMatcher(object):
return rec_walk(root)
class Pattern(object):
class Pattern:
def __init__(self, pattern_str):
self.exclusion = False
if pattern_str.startswith("!"):