Skip to content

Commit 4c75773

Browse files
authored
Merge pull request #24 from muhammedsaidckr/fix-excepthook-typo
Fix typo in excepthook assignment
2 parents dae6ec3 + 16c13fe commit 4c75773

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

live-installer/main.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
from frontend import *
66
from frontend.dialogs import ErrorDialog
77

8-
single_instance()
9-
10-
118
gettext.install("live-installer", "/usr/share/locale")
129
sys.path.insert(1, '/lib/live-installer')
1310
if (os.path.isdir("/lib/live-installer")):
@@ -33,14 +30,17 @@ def exceptdebug(e, v, tb):
3330
traceback.print_tb(tb)
3431

3532

36-
sys.excapthook = exceptdebug
33+
sys.excepthook = exceptdebug
3734

3835
# main entry
3936
if __name__ == "__main__":
4037
if "--test" in sys.argv:
4138
os.environ["TEST"]="1"
4239
if "--expert" in sys.argv:
4340
os.environ["EXPERT_MODE"]="1"
41+
42+
# Check for single instance (after test mode is set)
43+
single_instance()
4444
if not is_root() and "--test" not in sys.argv:
4545
ErrorDialog(config.get("distro_title", "17g"), _("You must be root!"))
4646
exit(1)

live-installer/utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,11 @@ def set_governor(governor):
134134
i += 1
135135

136136
def single_instance():
137-
pidfile = "/run/live-installer.pid"
137+
# Use temp directory for PID file in test mode
138+
if "TEST" in os.environ:
139+
pidfile = "/tmp/live-installer.pid"
140+
else:
141+
pidfile = "/run/live-installer.pid"
138142
def writepid():
139143
with open(pidfile, "w") as f:
140144
f.write(str(os.getpid()))

0 commit comments

Comments
 (0)