Fix some more left-overs of py2<->py3 PRs
Related to #1411, #1414 and #1415
This commit is contained in:
parent
7ed1f4cb9e
commit
cba742a94f
3 changed files with 7 additions and 7 deletions
|
|
@ -472,7 +472,7 @@ def dict_merge(a, b):
|
|||
if not isinstance(b, dict):
|
||||
return b
|
||||
result = deepcopy(a)
|
||||
for k, v in b.iteritems():
|
||||
for k, v in b.items():
|
||||
if k in result and isinstance(result[k], dict):
|
||||
result[k] = dict_merge(result[k], v)
|
||||
else:
|
||||
|
|
@ -508,7 +508,7 @@ def dict_sanitize(a, b):
|
|||
return a
|
||||
|
||||
result = deepcopy(a)
|
||||
for k, v in a.iteritems():
|
||||
for k, v in a.items():
|
||||
if not k in b:
|
||||
del result[k]
|
||||
elif isinstance(v, dict):
|
||||
|
|
@ -606,7 +606,7 @@ def dict_contains_keys(keys, dictionary):
|
|||
if not isinstance(keys, dict) or not isinstance(dictionary, dict):
|
||||
return False
|
||||
|
||||
for k, v in keys.iteritems():
|
||||
for k, v in keys.items():
|
||||
if not k in dictionary:
|
||||
return False
|
||||
elif isinstance(v, dict):
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ class DaemonTest(unittest.TestCase):
|
|||
self.assertEqual(self.error_method.call_count, 1)
|
||||
mock_chdir.assert_called_once_with("/")
|
||||
mock_setsid.assert_called_once_with()
|
||||
mock_umask.assert_called_once_with(002)
|
||||
mock_umask.assert_called_once_with(0o002)
|
||||
|
||||
@mock.patch("sys.stdin")
|
||||
@mock.patch("sys.stdout")
|
||||
|
|
|
|||
|
|
@ -181,7 +181,7 @@ class TempDirTest(unittest.TestCase):
|
|||
|
||||
# test
|
||||
with octoprint.util.tempdir() as td:
|
||||
self.assertEquals(td, path)
|
||||
self.assertEqual(td, path)
|
||||
|
||||
# assert
|
||||
mock_mkdtemp.assert_called_once_with()
|
||||
|
|
@ -198,7 +198,7 @@ class TempDirTest(unittest.TestCase):
|
|||
|
||||
# test
|
||||
with octoprint.util.tempdir(prefix="prefix", suffix="suffix", dir="dir") as td:
|
||||
self.assertEquals(td, path)
|
||||
self.assertEqual(td, path)
|
||||
|
||||
# assert
|
||||
mock_mkdtemp.assert_called_once_with(prefix="prefix", suffix="suffix", dir="dir")
|
||||
|
|
@ -217,7 +217,7 @@ class TempDirTest(unittest.TestCase):
|
|||
|
||||
# test
|
||||
with octoprint.util.tempdir(ignore_errors=True, onerror=onerror) as td:
|
||||
self.assertEquals(td, path)
|
||||
self.assertEqual(td, path)
|
||||
|
||||
# assert
|
||||
mock_mkdtemp.assert_called_once_with()
|
||||
|
|
|
|||
Loading…
Reference in a new issue