From ebbe4570d591e740994d0fd97fcfe387a195bc7b Mon Sep 17 00:00:00 2001 From: k4yt3x Date: Sat, 2 Apr 2022 05:29:54 +0000 Subject: [PATCH] check bools explicitly --- video2x/decoder.py | 4 ++-- video2x/interpolator.py | 2 +- video2x/pipe_printer.py | 2 +- video2x/upscaler.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/video2x/decoder.py b/video2x/decoder.py index 56192f7..1e8a3ad 100755 --- a/video2x/decoder.py +++ b/video2x/decoder.py @@ -114,7 +114,7 @@ class VideoDecoder(threading.Thread): # continue running until an exception occurs # or all frames have been decoded - while self.running: + while self.running is True: # pause if pause flag is set if self.pause.value is True: @@ -140,7 +140,7 @@ class VideoDecoder(threading.Thread): # keep checking if the running flag is set to False # while waiting to put the next image into the queue - while self.running: + while self.running is True: with contextlib.suppress(queue.Full): self.processing_queue.put( ( diff --git a/video2x/interpolator.py b/video2x/interpolator.py index c104f93..44e0f7a 100755 --- a/video2x/interpolator.py +++ b/video2x/interpolator.py @@ -57,7 +57,7 @@ class Interpolator(multiprocessing.Process): f"Interpolator process {self.name} initiating" ) processor_objects = {} - while self.running: + while self.running is True: try: # pause if pause flag is set if self.pause.value is True: diff --git a/video2x/pipe_printer.py b/video2x/pipe_printer.py index e03a180..a6cd22a 100755 --- a/video2x/pipe_printer.py +++ b/video2x/pipe_printer.py @@ -47,7 +47,7 @@ class PipePrinter(threading.Thread): self.running = True # keep printing contents in the PIPE - while self.running: + while self.running is True: time.sleep(0.5) try: diff --git a/video2x/upscaler.py b/video2x/upscaler.py index edd5567..40ba0c5 100755 --- a/video2x/upscaler.py +++ b/video2x/upscaler.py @@ -75,7 +75,7 @@ class Upscaler(multiprocessing.Process): f"Upscaler process {self.name} initiating" ) processor_objects = {} - while self.running: + while self.running is True: try: # pause if pause flag is set if self.pause.value is True: