-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Fixes Formatting Exception #25088
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
Merged
Merged
Fixes Formatting Exception #25088
Changes from 9 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
3200ff9
Fixes Formatting Exception
EternalLearner42 8acc296
Fixed try/except block
EternalLearner42 871b2c2
Fixed whitespace
EternalLearner42 b5771c7
Updated variables
EternalLearner42 f681c80
Updated libraries, variables
EternalLearner42 93862be
Updated with the fixing of #25080
EternalLearner42 7c4dea9
Improved issue description
EternalLearner42 1eb54eb
added test for #25080
EternalLearner42 b8aa472
Mock subprocess
TomAugspurger 9cacbfa
Updated the issue
EternalLearner42 21f01be
Merge branch 'master' into PR_TOOL_MERGE_PR_25088
jreback a2b414c
fix test
jreback File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ | |
|
||
import os | ||
import shutil | ||
import subprocess | ||
|
||
from pandas.compat import PY3 | ||
|
||
|
@@ -94,22 +95,29 @@ def _get_terminal_size_tput(): | |
# get terminal width | ||
# src: http://stackoverflow.com/questions/263890/how-do-i-find-the-width | ||
# -height-of-a-terminal-window | ||
|
||
try: | ||
import subprocess | ||
proc = subprocess.Popen(["tput", "cols"], | ||
jreback marked this conversation as resolved.
Show resolved
Hide resolved
|
||
stdin=subprocess.PIPE, | ||
stdout=subprocess.PIPE) | ||
output = proc.communicate(input=None) | ||
cols = int(output[0]) | ||
output_cols = proc.communicate(input=None) | ||
proc = subprocess.Popen(["tput", "lines"], | ||
stdin=subprocess.PIPE, | ||
stdout=subprocess.PIPE) | ||
output = proc.communicate(input=None) | ||
rows = int(output[0]) | ||
return (cols, rows) | ||
output_rows = proc.communicate(input=None) | ||
except OSError: | ||
return None | ||
|
||
try: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add a blank line & a comment here on what you are doing |
||
# Some terminals (e.g. spyder) may report a terminal size of '', | ||
# making the `int` fail. | ||
|
||
cols = int(output_cols[0]) | ||
rows = int(output_rows[0]) | ||
return cols, rows | ||
except (ValueError, IndexError): | ||
return None | ||
|
||
|
||
def _get_terminal_size_linux(): | ||
def ioctl_GWINSZ(fd): | ||
|
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
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.
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.
use
(:issue:`25080`)
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.
Man, I'm extremely sorry, I only saw this now! Making changes
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.
There. Are there any other changes I should make?