be python3.4 compatible #19

Merged
Solvik merged 2 commits from feature/python3.5 into master 2019-08-08 10:43:10 +02:00
Showing only changes of commit a22b648b8a - Show all commits

View file

@ -19,6 +19,12 @@ field_map = {
} }
def merge_two_dicts(x, y):
z = x.copy()
z.update(y)
return z
ramnes commented 2019-08-08 12:10:42 +02:00 (Migrated from github.com)

You forgot to remove this apparently.

You forgot to remove this apparently.
class Ethtool(): class Ethtool():
""" """
This class aims to parse ethtool output This class aims to parse ethtool output
@ -67,7 +73,8 @@ class Ethtool():
def parse(self): def parse(self):
if which('ethtool') is None: if which('ethtool') is None:
return None return None
return { # TODO >= py35: return {**a, **b}
**self._parse_ethtool_output(), return merge_two_dicts(
**self._parse_ethtool_module_output(), self._parse_ethtool_output(),
} self._parse_ethtool_module_output()
)