Skip to content

Commit

Permalink
Merge pull request #35 from drobak12/Close_opened_file
Browse files Browse the repository at this point in the history
Fixing file descriptor leak
  • Loading branch information
jblance authored Aug 4, 2020
2 parents f6dd0af + 07dbd2e commit 759e6d7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mppsolar/mppinverter.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,10 @@ def _doDirectUsbCommand(self, command):
response_line = response_line[:response_line.find(bytes([13])) + 1]
break
log.debug('usb byte_response was: %s', response_line)

# close file
os.close(usb0)

command.setByteResponse(response_line)
return command

Expand Down

0 comments on commit 759e6d7

Please sign in to comment.