Browse Source

Merge branch 'master' of https://github.com/leotada/PyNFe

pull/7/head
Junior Tada 10 years ago
parent
commit
153b1f3787
  1. 8
      pynfe/processamento/comunicacao.py

8
pynfe/processamento/comunicacao.py

@ -50,7 +50,11 @@ class ComunicacaoSefaz(Comunicacao):
if indSinc == 1: if indSinc == 1:
# Procuta status no xml # Procuta status no xml
ns = {'ns':'http://www.portalfiscal.inf.br/nfe'} # namespace ns = {'ns':'http://www.portalfiscal.inf.br/nfe'} # namespace
prot = etree.fromstring(retorno.text)
try:
prot = etree.fromstring(retorno.text)
except ValueError:
#em SP retorno.text apresenta erro
prot = etree.fromstring(retorno.content)
try: try:
# Protocolo com envio OK # Protocolo com envio OK
infProt = prot[1][0][0][6] # root protNFe infProt = prot[1][0][0][6] # root protNFe
@ -427,4 +431,4 @@ class ComunicacaoNfse(Comunicacao):
except requests.exceptions.ConnectionError as e: except requests.exceptions.ConnectionError as e:
raise e raise e
finally: finally:
certificadoA1.excluir()
certificadoA1.excluir()
Loading…
Cancel
Save