Cancel close only if literal False|None _device
This commit is contained in:
parent
363d322265
commit
5daf3efa30
@ -138,7 +138,7 @@ class Win32Raw(Escpos):
|
|||||||
|
|
||||||
def close(self) -> None:
|
def close(self) -> None:
|
||||||
"""Close connection to default printer."""
|
"""Close connection to default printer."""
|
||||||
if not self._device:
|
if self._device is False or self._device is None: # Literal False | None
|
||||||
return
|
return
|
||||||
logging.info("Closing Win32Raw connection to printer %s", self.printer_name)
|
logging.info("Closing Win32Raw connection to printer %s", self.printer_name)
|
||||||
win32print.EndPagePrinter(self._device)
|
win32print.EndPagePrinter(self._device)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user