Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 39b5181

Browse files
committed
Removed codepath for Python < 3.6 #11949
1 parent f6b22cc commit 39b5181

4 files changed

Lines changed: 3 additions & 25 deletions

File tree

IPython/core/interactiveshell.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -166,13 +166,7 @@ def removed_co_newlocals(function:types.FunctionType) -> types.FunctionType:
166166
# we still need to run things using the asyncio eventloop, but there is no
167167
# async integration
168168
from .async_helpers import (_asyncio_runner, _asyncify, _pseudo_sync_runner)
169-
if sys.version_info > (3, 5):
170-
from .async_helpers import _curio_runner, _trio_runner, _should_be_async
171-
else :
172-
_curio_runner = _trio_runner = None
173-
174-
def _should_be_async(cell:str)->bool:
175-
return False
169+
from .async_helpers import _curio_runner, _trio_runner, _should_be_async
176170

177171

178172
def _ast_asyncify(cell:str, wrapper_name:str) -> ast.Module:
@@ -2245,8 +2239,7 @@ def init_magics(self):
22452239
m.NamespaceMagics, m.OSMagics, m.PackagingMagics,
22462240
m.PylabMagics, m.ScriptMagics,
22472241
)
2248-
if sys.version_info >(3,5):
2249-
self.register_magics(m.AsyncMagics)
2242+
self.register_magics(m.AsyncMagics)
22502243

22512244
# Register Magic Aliases
22522245
mman = self.magics_manager

IPython/lib/pretty.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def _repr_pretty_(self, p, cycle):
9999
MAX_SEQ_LENGTH = 1000
100100
# The language spec says that dicts preserve order from 3.7, but CPython
101101
# does so from 3.6, so it seems likely that people will expect that.
102-
DICT_IS_ORDERED = sys.version_info >= (3, 6)
102+
DICT_IS_ORDERED = True
103103
_re_pattern_type = type(re.compile(''))
104104

105105
def _safe_getattr(obj, attr, default=None):

IPython/terminal/interactiveshell.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -424,21 +424,10 @@ def prompt_for_code(self):
424424
**self._extra_prompt_options())
425425
return text
426426

427-
def enable_win_unicode_console(self):
428-
if sys.version_info >= (3, 6):
429-
# Since PEP 528, Python uses the unicode APIs for the Windows
430-
# console by default, so WUC shouldn't be needed.
431-
return
432-
433-
import win_unicode_console
434-
win_unicode_console.enable()
435-
436427
def init_io(self):
437428
if sys.platform not in {'win32', 'cli'}:
438429
return
439430

440-
self.enable_win_unicode_console()
441-
442431
import colorama
443432
colorama.init()
444433

tools/gen_latex_symbols.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@
1111

1212
import os, sys
1313

14-
if sys.version_info[0] < 3:
15-
print("This script must be run with Python 3, exiting...")
16-
sys.exit(1)
17-
1814
# Import the Julia LaTeX symbols
1915
print('Importing latex_symbols.js from Julia...')
2016
import requests

0 commit comments

Comments
 (0)