mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 14:41:25 +00:00
replacing os.rename() by shutil.move in ifcpatch
This commit is contained in:
@@ -19,6 +19,7 @@
|
|||||||
# along with IfcPatch. If not, see <http://www.gnu.org/licenses/>.
|
# along with IfcPatch. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import shutil
|
||||||
import ifcopenshell
|
import ifcopenshell
|
||||||
import logging
|
import logging
|
||||||
import typing
|
import typing
|
||||||
@@ -99,7 +100,8 @@ def write(output: Union[ifcopenshell.file, str], filepath: str) -> None:
|
|||||||
return
|
return
|
||||||
elif isinstance(output, str):
|
elif isinstance(output, str):
|
||||||
if os.path.exists(output):
|
if os.path.exists(output):
|
||||||
os.rename(output, filepath)
|
print('DEBUG shutil')
|
||||||
|
shutil.move(output, filepath)
|
||||||
else:
|
else:
|
||||||
with open(filepath, "w") as text_file:
|
with open(filepath, "w") as text_file:
|
||||||
text_file.write(output)
|
text_file.write(output)
|
||||||
|
|||||||
Reference in New Issue
Block a user