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

Skip to content

Commit 288afbf

Browse files
committed
update
1 parent 1b289e4 commit 288afbf

4 files changed

Lines changed: 14 additions & 23 deletions

File tree

.github/workflows/mypy.yml

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,9 @@ jobs:
2626
pip install mypy pyflakes flake8
2727
- name: Lint with mypy
2828
run: |
29-
mypy IPython/terminal/ptutils.py
30-
mypy IPython/core/magics/*.py
31-
mypy IPython/terminal/__init__.py
32-
mypy IPython/terminal/console.py
33-
#mypy IPython/terminal/debugger.py
34-
#mypy IPython/terminal/embed.py
35-
mypy IPython/terminal/interactiveshell.py
36-
mypy IPython/terminal/ipapp.py
37-
mypy IPython/terminal/magics.py
38-
mypy IPython/terminal/prompts.py
39-
mypy IPython/terminal/ptshell.py
40-
mypy IPython/terminal/ptutils.py
41-
mypy IPython/terminal/shortcuts.py
42-
mypy IPython/core/c*.py
29+
mypy -p IPython.terminal
30+
mypy -p IPython.core.magics
4331
- name: Lint with pyflakes
4432
run: |
4533
flake8 IPython/core/magics/script.py
34+
flake8 IPython/core/magics/packaging.py

IPython/terminal/debugger.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,6 @@ def set_trace(frame=None):
161161
# happened after hitting "c", this is needed in order to
162162
# be able to quit the debugging session (see #9950).
163163
old_trace_dispatch = pdb.Pdb.trace_dispatch
164-
pdb.Pdb = TerminalPdb
165-
pdb.Pdb.trace_dispatch = old_trace_dispatch
164+
pdb.Pdb = TerminalPdb # type: ignore
165+
pdb.Pdb.trace_dispatch = old_trace_dispatch # type: ignore
166166
pdb.main()

IPython/terminal/embed.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
from traitlets import Bool, CBool, Unicode
2020
from IPython.utils.io import ask_yes_no
2121

22+
from typing import Set
23+
2224
class KillEmbedded(Exception):pass
2325

2426
# kept for backward compatibility as IPython 6 was released with
@@ -123,17 +125,17 @@ class InteractiveShellEmbed(TerminalInteractiveShell):
123125
help="Automatically set the terminal title"
124126
).tag(config=True)
125127

126-
_inactive_locations = set()
128+
_inactive_locations: Set[str] = set()
129+
130+
def _disable_init_location(self):
131+
"""Disable the current Instance creation location"""
132+
InteractiveShellEmbed._inactive_locations.add(self._init_location_id)
127133

128134
@property
129135
def embedded_active(self):
130136
return (self._call_location_id not in InteractiveShellEmbed._inactive_locations)\
131137
and (self._init_location_id not in InteractiveShellEmbed._inactive_locations)
132138

133-
def _disable_init_location(self):
134-
"""Disable the current Instance creation location"""
135-
InteractiveShellEmbed._inactive_locations.add(self._init_location_id)
136-
137139
@embedded_active.setter
138140
def embedded_active(self, value):
139141
if value:

IPython/terminal/pt_inputhooks/osx.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import ctypes.util
1010
from threading import Event
1111

12-
objc = ctypes.cdll.LoadLibrary(ctypes.util.find_library('objc'))
12+
objc = ctypes.cdll.LoadLibrary(ctypes.util.find_library("objc")) # type: ignore
1313

1414
void_p = ctypes.c_void_p
1515

@@ -37,7 +37,7 @@ def C(classname):
3737
# end obj-c boilerplate from appnope
3838

3939
# CoreFoundation C-API calls we will use:
40-
CoreFoundation = ctypes.cdll.LoadLibrary(ctypes.util.find_library('CoreFoundation'))
40+
CoreFoundation = ctypes.cdll.LoadLibrary(ctypes.util.find_library("CoreFoundation")) # type: ignore
4141

4242
CFFileDescriptorCreate = CoreFoundation.CFFileDescriptorCreate
4343
CFFileDescriptorCreate.restype = void_p

0 commit comments

Comments
 (0)