Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ddelange committed Dec 15, 2024
1 parent a20dff1 commit 00a83c6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion smart_open/hdfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,15 @@ def __init__(self, uri):

@property
def closed(self):
return self._sub.stdin.closed
return self._sub is None or self._sub.stdin.closed

def close(self):
if self.closed:
return
self.flush()
self._sub.stdin.close()
self._sub.wait()
self._sub = None

def flush(self):
self._sub.stdin.flush()
Expand Down

0 comments on commit 00a83c6

Please sign in to comment.