Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(5)

Side by Side Diff: Lib/idlelib/PyShell.py

Issue 10639: reindent.py converts newlines to platform default
Patch Set: Created 8 years, 8 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Lib/ftplib.py ('k') | Lib/importlib/test/source/test_file_loader.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #! /usr/bin/env python3 1 #! /usr/bin/env python3
2 2
3 import os 3 import os
4 import os.path 4 import os.path
5 import sys 5 import sys
6 import getopt 6 import getopt
7 import re 7 import re
8 import socket 8 import socket
9 import time 9 import time
10 import threading 10 import threading
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 import warnings 52 import warnings
53 except ImportError: 53 except ImportError:
54 pass 54 pass
55 else: 55 else:
56 def idle_showwarning(message, category, filename, lineno, 56 def idle_showwarning(message, category, filename, lineno,
57 file=None, line=None): 57 file=None, line=None):
58 if file is None: 58 if file is None:
59 file = warning_stream 59 file = warning_stream
60 try: 60 try:
61 file.write(warnings.formatwarning(message, category, filename, 61 file.write(warnings.formatwarning(message, category, filename,
62 lineno, line=line)) 62 lineno, file=file, line=line))
63 except IOError: 63 except IOError:
64 pass ## file (probably __stderr__) is invalid, warning dropped. 64 pass ## file (probably __stderr__) is invalid, warning dropped.
65 warnings.showwarning = idle_showwarning 65 warnings.showwarning = idle_showwarning
66 def idle_formatwarning(message, category, filename, lineno, line=None): 66 def idle_formatwarning(message, category, filename, lineno, line=None):
67 """Format warnings the IDLE way""" 67 """Format warnings the IDLE way"""
68 s = "\nWarning (from warnings module):\n" 68 s = "\nWarning (from warnings module):\n"
69 s += ' File \"%s\", line %s\n' % (filename, lineno) 69 s += ' File \"%s\", line %s\n' % (filename, lineno)
70 if line is None: 70 if line is None:
71 line = linecache.getline(filename, lineno) 71 line = linecache.getline(filename, lineno)
72 line = line.strip() 72 line = line.strip()
(...skipping 1350 matching lines...) Expand 10 before | Expand all | Expand 10 after
1423 tkversionwarning = macosxSupport.tkVersionWarning(root) 1423 tkversionwarning = macosxSupport.tkVersionWarning(root)
1424 if tkversionwarning: 1424 if tkversionwarning:
1425 shell.interp.runcommand(''.join(("print('", tkversionwarning, "')"))) 1425 shell.interp.runcommand(''.join(("print('", tkversionwarning, "')")))
1426 1426
1427 root.mainloop() 1427 root.mainloop()
1428 root.destroy() 1428 root.destroy()
1429 1429
1430 if __name__ == "__main__": 1430 if __name__ == "__main__":
1431 sys.modules['PyShell'] = sys.modules['__main__'] 1431 sys.modules['PyShell'] = sys.modules['__main__']
1432 main() 1432 main()
OLDNEW
« no previous file with comments | « Lib/ftplib.py ('k') | Lib/importlib/test/source/test_file_loader.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+