Skip to content

Commit 7230118

Browse files
committed
Remove unused code
1 parent e66bc4b commit 7230118

2 files changed

Lines changed: 0 additions & 27 deletions

File tree

IPython/frontend/terminal/ipapp.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
InteractiveShellApp, shell_flags, shell_aliases
4949
)
5050
from IPython.frontend.terminal.interactiveshell import TerminalInteractiveShell
51-
from IPython.lib import inputhook
5251
from IPython.utils import warn
5352
from IPython.utils.path import get_ipython_dir, check_for_old_config
5453
from IPython.utils.traitlets import (

IPython/utils/text.py

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424
import os
2525
import re
26-
import shutil
2726
import sys
2827
import textwrap
2928
from string import Formatter
@@ -403,31 +402,6 @@ def indent(instr,nspaces=4, ntabs=0, flatten=False):
403402
else:
404403
return outstr
405404

406-
def native_line_ends(filename,backup=1):
407-
"""Convert (in-place) a file to line-ends native to the current OS.
408-
409-
If the optional backup argument is given as false, no backup of the
410-
original file is left. """
411-
412-
backup_suffixes = {'posix':'~','dos':'.bak','nt':'.bak','mac':'.bak'}
413-
414-
bak_filename = filename + backup_suffixes[os.name]
415-
416-
original = open(filename).read()
417-
shutil.copy2(filename,bak_filename)
418-
try:
419-
new = open(filename,'wb')
420-
new.write(os.linesep.join(original.splitlines()))
421-
new.write(os.linesep) # ALWAYS put an eol at the end of the file
422-
new.close()
423-
except:
424-
os.rename(bak_filename,filename)
425-
if not backup:
426-
try:
427-
os.remove(bak_filename)
428-
except:
429-
pass
430-
431405

432406
def list_strings(arg):
433407
"""Always return a list of strings, given a string or list of strings

0 commit comments

Comments
 (0)