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

Add support for Sublime Text 3 #3

Closed

Conversation

jpotterm
Copy link

These are the changes I had to make in order to get this plugin to work with ST3. They are pretty straight forward so I don't think I broke anything, but I've only tested the import sorter and I haven't tested backwards compatibility for ST2

I removed ordereddict.OrderedDict because it doesn't seem necessary to support for python < 2.4, and UserDict was removed in python 3.

I hope this is useful to people.

@jpotterm jpotterm mentioned this pull request Nov 22, 2013
@graingert
Copy link

Can you add Fixes #1 to your commit, please?

@thijsdezoete
Copy link
Owner

Oh, lol, disregard my other comment in #1 :)

from collections import OrderedDict
except ImportError:
from ordereddict import OrderedDict
from collections import OrderedDict
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will probably break ST2 installs, why did you remove the try/except?

My st2 install gives me this version:

>>> import sys
>>> print (sys.version)
2.6.7 (r267:88850, Oct 11 2012, 20:15:00) 
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)]

http://docs.python.org/2/library/collections.html#collections.OrderedDict
If you look there, ordereddict was added in v2.7

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, you're right, I misread. I thought it was added in 2.4 but now I see that it's collections that was added in 2.4, and OrderedDict was added in 2.7.

I removed it because ordereddict.OrderedDict depends on UserDict which doesn't exist in python 3 and leads to an import error. I'll add an if statement and send another pull request. Good call!

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries. I'll merge the PR as soon as this gets fixed. Thanks for your contribution!

@jpotterm
Copy link
Author

This pull request is superseded by #4.

@jpotterm jpotterm closed this Nov 26, 2013
@jpotterm jpotterm deleted the sublime-text-3-support branch November 26, 2013 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants