Dolda2000 GitWeb
/
pdm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
6e858b0
)
Improve perfproxy close behavior.
author
Fredrik Tolf
<fredrik@dolda2000.com>
Tue, 11 Jun 2024 23:24:44 +0000
(
01:24
+0200)
committer
Fredrik Tolf
<fredrik@dolda2000.com>
Tue, 11 Jun 2024 23:24:44 +0000
(
01:24
+0200)
pdm/cli.py
patch
|
blob
|
blame
|
history
diff --git
a/pdm/cli.py
b/pdm/cli.py
index
7cfa263
..
df04883
100644
(file)
--- a/
pdm/cli.py
+++ b/
pdm/cli.py
@@
-71,13
+71,19
@@
class client(object):
if proto is not None:
self.select(proto)
if proto is not None:
self.select(proto)
+ @property
+ def closed(self):
+ return self.sk is None
+
def close(self):
"""Close this connection"""
def close(self):
"""Close this connection"""
- self.sk.close()
+ if self.sk is not None:
+ self.sk.close()
+ self.sk = None
def fileno(self):
"""Return the file descriptor of the underlying socket."""
def fileno(self):
"""Return the file descriptor of the underlying socket."""
- return self.sk.fileno()
+ return self.sk.fileno()
if self.sk else None
def readline(self):
"""Read a single NL-terminated line and return it."""
def readline(self):
"""Read a single NL-terminated line and return it."""
@@
-197,7
+203,8
@@
class perfproxy(object):
def close(self):
if self.id is not None:
def close(self):
if self.id is not None:
- self.cl.run("unbind", self.id)
+ if not self.cl.closed:
+ self.cl.run("unbind", self.id)
del self.cl.proxies[self.id]
self.id = None
del self.cl.proxies[self.id]
self.id = None