-
Notifications
You must be signed in to change notification settings - Fork 12
Fix smtp block with python3 #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
vad
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
requires a small refactoring to avoid code duplication
| def block_smtp(whitelist): | ||
| def whitelisted(self, host, *args, **kwargs): | ||
| if isinstance(host, basestring) and host not in whitelist: | ||
| try: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you move this to the module level and reuse it in block_http?
adamchainz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use six?
|
@adamchainz there's no |
|
|
|
👍 to "it'll will make removal easier" |
|
Six would be a more expicit way to say: This conditional code is here because of 2-3 compatibility. It is easier to find all instances and remove them when we stop supporting python 2. Which won't be soon. |
No description provided.