Portando código do python 2 para 3#13
Open
willianrocha wants to merge 3 commits intoaleborba:masterfrom
Open
Conversation
iurisilvio
requested changes
Jul 11, 2017
packtrack/__init__.py
Outdated
| from dhl_gm import DhlGmTracker | ||
| from packtrack.correios import EncomendaRepository | ||
| from packtrack.royal import RoyalMail | ||
| from packtrack.dhl_gm import DhlGmTracker |
Collaborator
There was a problem hiding this comment.
Usa imports relativos (from .correios import EncomendaRepository). Para isso, precisa do from __future__ import absolute_import no inicio do arquivo.
packtrack/correios.py
Outdated
|
|
||
| def _init_scraper(self, backend): | ||
| from scraping import CorreiosWebsiteScraper, CorreiosRastroService | ||
| from packtrack.scraping import CorreiosWebsiteScraper, CorreiosRastroService |
Collaborator
There was a problem hiding this comment.
Mesma coisa, use import relativo.
packtrack/scraping.py
Outdated
| if html: | ||
| try: | ||
| html = html.decode('latin-1') | ||
| html = html.encode('latin-1') |
Collaborator
There was a problem hiding this comment.
Não tenho certeza se isso faz sentido.
iurisilvio
reviewed
Jul 11, 2017
| language: python | ||
|
|
||
| python: | ||
| - "3.6" |
Collaborator
There was a problem hiding this comment.
Precisa também rodar no python 2.7.
removido encode latin-1 desnecessario adicionado ao travis python 2.7
Owner
|
@iurisilvio é OK fazer o merge? Minha preocupação é como isso pode refletir no postmon caso atualize tudo. |
Collaborator
|
Teria como rodarmos num ambiente a parte para simular?
Local mesmo.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Modificado a sintaxe dos imports
Modificado para bytes e strings ao longo do código
Atualizado requirements
BeautifulSoup agora pede um parser, utilizei o lxml por ser o sugerido pela documentaçao