Skip to content
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

PY3: fix has_key and use six.moves.configparser #798

Merged
merged 1 commit into from Jul 14, 2014

Conversation

@felixonmars
Copy link
Contributor

@felixonmars felixonmars commented Jul 14, 2014

Yet another small change for py3k support.

@@ -75,7 +75,7 @@ def test_contains(self):
d = CaselessDict()
d['a'] = 1
assert 'a' in d
assert d.has_key('a')
assert 'a' in d.keys()

This comment has been minimized.

@felixonmars

felixonmars Jul 14, 2014
Author Contributor

Since this is a test for CarelessDict(), I suppose writing both "in" and "has_key" before was meant to something like this. Removing this line is also a solution :)

This comment has been minimized.

@kmike

kmike Jul 14, 2014
Member

I'd remove it

This comment has been minimized.

@felixonmars

felixonmars Jul 14, 2014
Author Contributor

Okay, I've resubmitted it to remove the line.

@@ -1,6 +1,6 @@
import sys
import os
from ConfigParser import SafeConfigParser
from six.moves.configparser import SafeConfigParser

This comment has been minimized.

@kmike

kmike Jul 14, 2014
Member

I thought it won't work in Python3 because SafeConfigParser was renamed to ConfigParser, but it turns out SafeConfigParser is still there (it is an undocumented ConfigParser alias).

This comment has been minimized.

@felixonmars

felixonmars Jul 14, 2014
Author Contributor

It was still in the docs of Python 3.1, but a quick test told me that it's still working in Python 3.4.

This comment has been minimized.

@kmike

kmike Jul 14, 2014
Member

they renamed it in Python 3.2

@kmike
Copy link
Member

@kmike kmike commented Jul 14, 2014

Making changes to bundled 3rd-party libraries is controversial, but as per @dangra's comment (#431 (comment)) it is OK to modify pydispatch. So merging it. Thanks!

kmike added a commit that referenced this pull request Jul 14, 2014
PY3: fix has_key and use six.moves.configparser
@kmike kmike merged commit 2f567f9 into scrapy:master Jul 14, 2014
1 check was pending
1 check was pending
continuous-integration/travis-ci The Travis CI build is in progress
Details
@dangra
Copy link
Member

@dangra dangra commented Jul 14, 2014

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.