Skip to content

Commit 104244e

Browse files
committed
Updated first start issue
1 parent 44af062 commit 104244e

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/petab_gui/app.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,17 @@ def main():
135135
args = parser.parse_args()
136136

137137
if sys.platform == "darwin":
138-
from Foundation import NSBundle # type: type: ignore[import]
139-
140-
bundle = NSBundle.mainBundle()
141-
info = bundle.localizedInfoDictionary() or bundle.infoDictionary()
142-
info["CFBundleName"] = APP_NAME
138+
try:
139+
from Foundation import NSBundle # type: ignore[import]
140+
141+
bundle = NSBundle.mainBundle()
142+
info = bundle.localizedInfoDictionary() or bundle.infoDictionary()
143+
info["CFBundleName"] = APP_NAME
144+
except ModuleNotFoundError:
145+
# If Foundation is still not found, the app will run without
146+
# setting the bundle name (non-critical macOS-specific feature)
147+
# Problem resolves after reactivating the virtual environment.
148+
pass
143149

144150
app = PEtabGuiApp(args.petab_yaml)
145151
sys.exit(app.exec())

0 commit comments

Comments
 (0)