Skip to content

Commit

Permalink
fix : play_process renamed to _play_process
Browse files Browse the repository at this point in the history
  • Loading branch information
sepandhaghighi committed Mar 29, 2024
1 parent 398348a commit 2071c81
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions nava/thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def __init__(self, loop, *args, **kwargs):
"""
super(NavaThread, self).__init__(*args, **kwargs)
self._sys_platform = sys.platform
self.play_process = None
self._play_process = None
self._loop = loop

def run(self):
Expand All @@ -32,11 +32,11 @@ def run(self):
"""
if self._target is not None:
if self._sys_platform == "win32":
self.play_process = self._target(*self._args, **self._kwargs)
self._play_process = self._target(*self._args, **self._kwargs)
else:
while True:
self.play_process = self._target(*self._args, **self._kwargs)
self.play_process.wait()
self._play_process = self._target(*self._args, **self._kwargs)
self._play_process.wait()
if not self._loop:
break

Expand All @@ -51,14 +51,14 @@ def stop(self):
import winsound
winsound.PlaySound(None, winsound.SND_PURGE)
else:
if self.play_process is not None:
if self._play_process is not None:
try:
self.play_process.stdout.close()
self.play_process.stdin.close()
self.play_process.stderr.close()
self.play_process.kill()
self.play_process.terminate()
self._play_process.stdout.close()
self._play_process.stdin.close()
self._play_process.stderr.close()
self._play_process.kill()
self._play_process.terminate()
except ProcessLookupError:
pass
finally:
self.play_process.wait()
self._play_process.wait()

0 comments on commit 2071c81

Please sign in to comment.