# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2021 CEA/DEN, EDF R&D
+# Copyright (C) 2007-2024 CEA, EDF
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
def WriteInTmpDir(func):
def decaratedFunc(*args,**kwargs):
- import tempfile,os
+ import tempfile,os, sys
ret = None
with tempfile.TemporaryDirectory() as tmpdirname:
os.chdir(tmpdirname)
ret = func(*args,**kwargs)
+ os.chdir(os.path.dirname(tmpdirname))
pass
return ret
return decaratedFunc