Skip to content

Commit ae2afaa

Browse files
committed
Fix api logic
1 parent 059f26e commit ae2afaa

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pygoruut/pygoruut.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,10 @@ def __str__(self):
5656

5757
class Pygoruut:
5858
def __init__(self, version=None, writeable_bin_dir=None, api=None):
59-
self.executable, self.platform, self.version = MyPlatformExecutable(version).get()
59+
if api is None:
60+
self.executable, self.platform, self.version = MyPlatformExecutable(version).get()
61+
else:
62+
self.executable = None
6063
if self.executable is None:
6164
if api is not None:
6265
self.executable = None
@@ -112,7 +115,7 @@ def compatible_version(self) -> str:
112115
return self.version.rstrip('0123456789')
113116

114117
def __del__(self):
115-
if hasattr(self, 'process'):
118+
if hasattr(self, 'process') and self.process is not None:
116119
self.process.terminate()
117120
self.process.wait()
118121

0 commit comments

Comments
 (0)