From e9dbbd80bc1bf7a65133cbe16c8deba10340da77 Mon Sep 17 00:00:00 2001 From: "Naelson Douglas C. Oliveira" Date: Sun, 31 Oct 2021 12:21:18 -0300 Subject: [PATCH] removed a default mutable argument pitfall (#809) --- labelImg.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/labelImg.py b/labelImg.py index 915ca04b..cc9edd9c 100755 --- a/labelImg.py +++ b/labelImg.py @@ -1600,11 +1600,13 @@ def read(filename, default=None): return default -def get_main_app(argv=[]): +def get_main_app(argv=None): """ Standard boilerplate Qt application code. Do everything but app.exec_() -- so that we can test the application in one thread """ + if not argv: + argv = [] app = QApplication(argv) app.setApplicationName(__appname__) app.setWindowIcon(new_icon("app"))