diff options
author | Angelos Evripiotis <jevripiotis@bloomberg.net> | 2019-06-11 17:28:17 +0100 |
---|---|---|
committer | Angelos Evripiotis <jevripiotis@bloomberg.net> | 2019-06-12 08:43:20 +0100 |
commit | bc98cc1875156eeee842f9c651b81a163b2c11dd (patch) | |
tree | 2446e3f2c877bd92a8fdf399ceec6b34e74a7404 /src/buildstream/_options | |
parent | 8900b02225024a5a0be5bfe59a23318b708bece7 (diff) | |
download | buildstream-bc98cc1875156eeee842f9c651b81a163b2c11dd.tar.gz |
Refactor 'super(cls, self)' -> 'super()'aevri/supersuper
For most use-cases with modern Python, it's not necessary to supply the
'type' or 'object-or-type' arguments to super().
Replace all our instances with arg-less super, which is less
error-prone.
https://docs.python.org/3.5/library/functions.html#super
Diffstat (limited to 'src/buildstream/_options')
-rw-r--r-- | src/buildstream/_options/optionarch.py | 2 | ||||
-rw-r--r-- | src/buildstream/_options/optionbool.py | 2 | ||||
-rw-r--r-- | src/buildstream/_options/optioneltmask.py | 2 | ||||
-rw-r--r-- | src/buildstream/_options/optionenum.py | 2 | ||||
-rw-r--r-- | src/buildstream/_options/optionflags.py | 2 | ||||
-rw-r--r-- | src/buildstream/_options/optionos.py | 2 |
6 files changed, 6 insertions, 6 deletions
diff --git a/src/buildstream/_options/optionarch.py b/src/buildstream/_options/optionarch.py index 0e2963c84..3117b8273 100644 --- a/src/buildstream/_options/optionarch.py +++ b/src/buildstream/_options/optionarch.py @@ -40,7 +40,7 @@ class OptionArch(OptionEnum): OPTION_TYPE = 'arch' def load(self, node): - super(OptionArch, self).load(node, allow_default_definition=False) + super().load(node, allow_default_definition=False) def load_default_value(self, node): arch = Platform.get_host_arch() diff --git a/src/buildstream/_options/optionbool.py b/src/buildstream/_options/optionbool.py index 867de22df..bdbb1d32a 100644 --- a/src/buildstream/_options/optionbool.py +++ b/src/buildstream/_options/optionbool.py @@ -32,7 +32,7 @@ class OptionBool(Option): def load(self, node): - super(OptionBool, self).load(node) + super().load(node) _yaml.node_validate(node, OPTION_SYMBOLS + ['default']) self.value = _yaml.node_get(node, bool, 'default') diff --git a/src/buildstream/_options/optioneltmask.py b/src/buildstream/_options/optioneltmask.py index 09c2ce8c2..507dc7070 100644 --- a/src/buildstream/_options/optioneltmask.py +++ b/src/buildstream/_options/optioneltmask.py @@ -33,7 +33,7 @@ class OptionEltMask(OptionFlags): def load(self, node): # Ask the parent constructor to disallow value definitions, # we define those automatically only. - super(OptionEltMask, self).load(node, allow_value_definitions=False) + super().load(node, allow_value_definitions=False) # Here we want all valid elements as possible values, # but we'll settle for just the relative filenames diff --git a/src/buildstream/_options/optionenum.py b/src/buildstream/_options/optionenum.py index 095b9c356..f214d779d 100644 --- a/src/buildstream/_options/optionenum.py +++ b/src/buildstream/_options/optionenum.py @@ -31,7 +31,7 @@ class OptionEnum(Option): OPTION_TYPE = 'enum' def load(self, node, allow_default_definition=True): - super(OptionEnum, self).load(node) + super().load(node) valid_symbols = OPTION_SYMBOLS + ['values'] if allow_default_definition: diff --git a/src/buildstream/_options/optionflags.py b/src/buildstream/_options/optionflags.py index 0271208d9..ba16244ba 100644 --- a/src/buildstream/_options/optionflags.py +++ b/src/buildstream/_options/optionflags.py @@ -31,7 +31,7 @@ class OptionFlags(Option): OPTION_TYPE = 'flags' def load(self, node, allow_value_definitions=True): - super(OptionFlags, self).load(node) + super().load(node) valid_symbols = OPTION_SYMBOLS + ['default'] if allow_value_definitions: diff --git a/src/buildstream/_options/optionos.py b/src/buildstream/_options/optionos.py index 2d46b70ba..6263a05a2 100644 --- a/src/buildstream/_options/optionos.py +++ b/src/buildstream/_options/optionos.py @@ -29,7 +29,7 @@ class OptionOS(OptionEnum): OPTION_TYPE = 'os' def load(self, node): - super(OptionOS, self).load(node, allow_default_definition=False) + super().load(node, allow_default_definition=False) def load_default_value(self, node): return platform.uname().system |