From: Oleg Broytman Date: Tue, 7 Jan 2014 11:19:40 +0000 (+0400) Subject: Fix a bug: open xsetbg.py with full path X-Git-Tag: v4.1.0~10 X-Git-Url: https://git.phdru.name/?p=xsetbg.git;a=commitdiff_plain;h=a43dfc879bacb5eaae7cc7644983623c58efe02a Fix a bug: open xsetbg.py with full path --- diff --git a/xsetbg.py b/xsetbg.py index ee9c5f8..d9472bc 100755 --- a/xsetbg.py +++ b/xsetbg.py @@ -153,7 +153,8 @@ if not images: def change(force=False): # Use the program's file as the lock file: # lock it to prevent two processes run in parallel. - lock_file = open("xsetbg.py", 'r') + lock_file = open(os.path.join(xsetbg_dir, 'xsetbg.py'), 'r') + try: flock(lock_file, LOCK_EX|LOCK_NB) except IOError: # already locked