Repository navigation
Vendor shutil.get_terminal_size. - #10587
Merged
Merged
Conversation
takluyver
reviewed
May 24, 2017
| try: | ||
| from backports.shutil_get_terminal_size import get_terminal_size as _get_terminal_size | ||
| except ImportError: | ||
| from _get_terminal_size import _get_terminal_size |
Member
There was a problem hiding this comment.
Let's put the . in for an explicit relative import. It's clearer, and if someone adds from __future__ import absolute_import, it won't break.
Use the vendored version only if import error. That should fix import error for many users. Closes ipython#9815. This is only against the 5.x branch as this is in the stdlib on Python 3
Carreau
force-pushed
the
vendor-terminal-size
branch
from
May 24, 2017 21:01
db7d187 to
e50d811
Compare
takluyver
reviewed
May 24, 2017
| @@ -0,0 +1,103 @@ | |||
| # vendored version of backports.get_terminal_size as nemesapece package are a | |||
| # mess and break, especially on ubuntu. This file is under MIT Licence. | |||
Member
There was a problem hiding this comment.
It should therefore include the copyright notice attributing the original file. And, technically, the permissions part of the MIT license as well, although I'm not going to complain if we just say 'MIT licence'.
The relevant bit of the MIT licence says:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
include commit hash, last commit, github URL
Member
Author
|
Licence added, link to repo, commit sha and date, updated to master version |
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.
Use the vendored version only if import error.
That should fix import error for many users.
Closes #9815.
This is only against the 5.x branch as this is in the stdlib on Python 3