mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
SF patch #701494: more apply removals
This commit is contained in:
parent
50c61d5a6c
commit
ff41c48a77
23 changed files with 2437 additions and 2449 deletions
|
|
@ -29,7 +29,7 @@ INSTALLATION
|
|||
|
||||
Put this file in your Python path, and create a file named {Python}:sitecustomize.py
|
||||
that contains:
|
||||
import icopen
|
||||
import icopen
|
||||
|
||||
(If {Python}:sitecustomizer.py already exists, just add the 'import' line to it.)
|
||||
|
||||
|
|
@ -42,18 +42,18 @@ import __builtin__
|
|||
_builtin_open = globals().get('_builtin_open', __builtin__.open)
|
||||
|
||||
def _open_with_typer(*args):
|
||||
file = apply(_builtin_open, args)
|
||||
filename = args[0]
|
||||
mode = 'r'
|
||||
if args[1:]:
|
||||
mode = args[1]
|
||||
if mode[0] == 'w':
|
||||
from ic import error, settypecreator
|
||||
try:
|
||||
settypecreator(filename)
|
||||
except error:
|
||||
pass
|
||||
return file
|
||||
file = _builtin_open(*args)
|
||||
filename = args[0]
|
||||
mode = 'r'
|
||||
if args[1:]:
|
||||
mode = args[1]
|
||||
if mode[0] == 'w':
|
||||
from ic import error, settypecreator
|
||||
try:
|
||||
settypecreator(filename)
|
||||
except error:
|
||||
pass
|
||||
return file
|
||||
|
||||
__builtin__.open = _open_with_typer
|
||||
|
||||
|
|
@ -63,4 +63,4 @@ _open_with_typer('test.py', 'w')
|
|||
_open_with_typer('test.txt', 'w')
|
||||
_open_with_typer('test.html', 'w')
|
||||
_open_with_typer('test.foo', 'w')
|
||||
"""
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue