From 7c1f6ba682c124fae3749c757939c0b5a695882e Mon Sep 17 00:00:00 2001 From: carcaroff Date: Wed, 29 Aug 2018 14:53:48 -0300 Subject: [PATCH] Adicionando checkagem apenas por None no if --- pytrustnfe/nfe/danfe.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pytrustnfe/nfe/danfe.py b/pytrustnfe/nfe/danfe.py index e8ec726..d809c08 100644 --- a/pytrustnfe/nfe/danfe.py +++ b/pytrustnfe/nfe/danfe.py @@ -158,7 +158,7 @@ class danfe(object): # Declaring variable to prevent future errors nId = 0 - if el_det: + if el_det is not None: list_desc = [] list_cod_prod = [] @@ -169,7 +169,7 @@ class danfe(object): ".//{http://www.portalfiscal.inf.br/nfe}infAdProd") list_ = wrap(tagtext(oNode=el_prod, cTag='xProd'), 56) - if infAdProd: + if infAdProd is not None: list_.extend(wrap(infAdProd.text, 56)) list_desc.append(list_)