diff --git a/fsl/utils/parse_data.py b/fsl/utils/parse_data.py
index 00826db245497bfcab1a6982468b751c3cc6156f..20e51d75218a87a850c3ce291ba75ef22a39c4ad 100644
--- a/fsl/utils/parse_data.py
+++ b/fsl/utils/parse_data.py
@@ -80,6 +80,3 @@ def Atlas(name):
         atlas_names = tuple(desc.atlasID for desc in atlases.listAtlases())
         raise argparse.ArgumentTypeError('Requested atlas %r not one of: %r' % (name, atlas_names))
     return atlases.loadAtlas(name)
-
-
-
diff --git a/tests/test_callfsl.py b/tests/test_callfsl.py
index 25c156f8783aa8e5dca554af7d0454a3d58a0ca7..25c972e386a2708a46f5fbcfeb139a995f63868b 100644
--- a/tests/test_callfsl.py
+++ b/tests/test_callfsl.py
@@ -75,6 +75,11 @@ def test_callfsl():
         with mock.patch('fsl.utils.callfsl.sp.check_output',
                         mock_check_output):
             callfsl.callFSL(cmd)
-        fslplatform.fsldir = None
-        with pytest.raises(Exception):
-            callfsl.callFSL(cmd)
+
+        try:
+            oldval = fslplatform.fsldir
+            fslplatform.fsldir = None
+            with pytest.raises(Exception):
+                callfsl.callFSL(cmd)
+        finally:
+            fslplatform.fsldir = oldval