Skip to content

Commit b920e8a

Browse files
ahmetahmet
authored andcommitted
PDF Viewer will stay open after python script is finished
1 parent 2f61b8e commit b920e8a

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

kicad-diff.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@
4949
import shlex
5050
from shutil import rmtree, which, copy2
5151
from struct import unpack
52-
from subprocess import call, PIPE, run, STDOUT, CalledProcessError
52+
import subprocess
53+
from subprocess import call, PIPE, run, STDOUT, CalledProcessError, Popen
5354
from sys import exit
5455
from tempfile import mkdtemp, NamedTemporaryFile
5556
import time
@@ -1022,5 +1023,5 @@ def check_image_magick():
10221023
output_pdf = DiffImages(old_file_hash, new_file_hash, layers_old, layers_new, args.only_different, changed)
10231024

10241025
if args.no_reader:
1025-
call(['xdg-open', output_pdf])
1026+
Popen(['xdg-open', output_pdf], start_new_session=True, stdin=subprocess.DEVNULL, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
10261027
time.sleep(5)

0 commit comments

Comments
 (0)