From 912ff854161bcbd75cab1a7699e8747f30bc1003 Mon Sep 17 00:00:00 2001 From: CristianoMafraJunior Date: Thu, 2 Jul 2026 15:22:17 -0300 Subject: [PATCH] [FIX] warnings --- brazilfiscalreport/dacte/dacte.py | 3 ++- brazilfiscalreport/damdfe/damdfe.py | 4 ++-- brazilfiscalreport/danfe/danfe.py | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/brazilfiscalreport/dacte/dacte.py b/brazilfiscalreport/dacte/dacte.py index d8a8cae0..9edd90ee 100644 --- a/brazilfiscalreport/dacte/dacte.py +++ b/brazilfiscalreport/dacte/dacte.py @@ -72,7 +72,8 @@ def __init__(self, xml, config: DacteConfig = None): self.outros = root.find(f"{URL}toma4") self.inf_prot = root.find(f"{URL}infProt") self.inf_cte_supl = root.find(f"{URL}infCTeSupl") - self.tomador = root.find(f"{URL}toma3") or self.outros + toma3 = root.find(f"{URL}toma3") + self.tomador = toma3 if toma3 is not None else self.outros self.inf_carga = root.find(f"{URL}infCarga") self.inf_doc = root.find(f"{URL}infDoc") self.v_prest = root.find(f"{URL}vPrest") diff --git a/brazilfiscalreport/damdfe/damdfe.py b/brazilfiscalreport/damdfe/damdfe.py index 078452f3..a0d10009 100644 --- a/brazilfiscalreport/damdfe/damdfe.py +++ b/brazilfiscalreport/damdfe/damdfe.py @@ -125,7 +125,7 @@ def _build_seg_str(self): def _build_ciot_str(self): self.inf_ciot_str = [] - if not self.inf_modal: + if self.inf_modal is None: return self.inf_ciot_str for ciot_node in self.inf_modal.findall(f"{URL}rodo/{URL}infANTT/{URL}infCIOT"): @@ -237,7 +237,7 @@ def _draw_void_watermark(self): when the environment is homologation. """ is_production_environment = extract_text(self.ide, "tpAmb") == "1" - is_protocol_available = bool(self.prot_mdfe) + is_protocol_available = self.prot_mdfe is not None # Exit early if no watermark is needed if is_production_environment and is_protocol_available: diff --git a/brazilfiscalreport/danfe/danfe.py b/brazilfiscalreport/danfe/danfe.py index 61f53a26..0ec1ddcd 100644 --- a/brazilfiscalreport/danfe/danfe.py +++ b/brazilfiscalreport/danfe/danfe.py @@ -524,7 +524,7 @@ def _draw_void_watermark(self): when the environment is homologation. """ is_production_environment = extract_text(self.ide, "tpAmb") == "1" - is_protocol_available = bool(self.prot_nfe) + is_protocol_available = self.prot_nfe is not None # Exit early if no watermark is needed watermark_text = None @@ -1094,7 +1094,7 @@ def _draw_location_block(self, elem, description): block_entrega.render() def _draw_billing(self): - if not self.cobr: + if self.cobr is None: # Skip return @@ -1451,7 +1451,7 @@ def _draw_products(self, height_product_table, products, additional_data=""): return row_info, add_info_lines, max_add_info_lines def _draw_issqn_calculation(self): - if not self.issqn_tot: + if self.issqn_tot is None: return # content data im = extract_text(self.emit, "IM")