diff --git a/lib/iris/_data_manager.py b/lib/iris/_data_manager.py index c5b7df8e1c..d27d759161 100644 --- a/lib/iris/_data_manager.py +++ b/lib/iris/_data_manager.py @@ -161,9 +161,11 @@ def _deepcopy(self, memo, data=None): try: if iris.FUTURE.dataless_cube and data is None: shape = self.shape - elif (iris.FUTURE.dataless_cube and type(data) is str and data == iris.MAINTAIN_DATA) or ( - data is None - ): + elif ( + iris.FUTURE.dataless_cube + and type(data) is str + and data == iris.MAINTAIN_DATA + ) or (data is None): # Copy the managed data. if self.has_lazy_data(): data = copy.deepcopy(self._lazy_array, memo) diff --git a/lib/iris/tests/unit/cube/test_Cube.py b/lib/iris/tests/unit/cube/test_Cube.py index 7dc3068866..cf832719a0 100644 --- a/lib/iris/tests/unit/cube/test_Cube.py +++ b/lib/iris/tests/unit/cube/test_Cube.py @@ -2090,7 +2090,7 @@ def test_copy_new_data(self): _shared_utils.assert_array_equal(new_cube.data, new_data) def test_copy_remove_data(self): - with iris.FUTURE.context(dataless_cube = True): + with iris.FUTURE.context(dataless_cube=True): cube = stock.simple_3d() new_cube = cube.copy() assert new_cube.metadata == cube.metadata