fixed small bug

master
Ugo Finnendahl 3 years ago
parent b32b00113b
commit 5acda0fa22
  1. 5
      pybindmagic/__init__.py

@ -174,8 +174,9 @@ def cpp(line, cell, *what):
# otherwise we import all names that don't begin with _
names = [x for x in mdl.__dict__ if not x.startswith("_")]
except Exception as e:
with open(os.path.join(cmake_path,"CMakeLists.txt"), 'w') as f:
f.write(cmake)
if cmake_path is not None:
with open(os.path.join(cmake_path,"CMakeLists.txt"), 'w') as f:
f.write(cmake)
if os.path.exists(os.path.join(path,f"{name}.cpp")):
os.remove(os.path.join(path,f"{name}.cpp"))
raise e

Loading…
Cancel
Save