Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

misc whitespace and line too long #720

Merged
merged 1 commit into from
Jul 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/embedding/ipkernel_qtapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def add_widgets(self):
#-----------------------------------------------------------------------------

if __name__ == "__main__":
app = Qt.QApplication([])
app = Qt.QApplication([])
# Create our window
win = SimpleWindow(app)
win.show()
Expand Down
2 changes: 1 addition & 1 deletion examples/embedding/ipkernel_wxapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def __init__(self, parent, title):
# Create the menubar
menuBar = wx.MenuBar()

# and a menu
# and a menu
menu = wx.Menu()

# add an item to the menu, using \tKeyName automatically
Expand Down
1 change: 0 additions & 1 deletion ipykernel/_eventloop_macos.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,3 @@ def mainloop(duration=1):
# Run the loop manually in this case,
# since there may be events still to process (ipython/ipython#9734)
CoreFoundation.CFRunLoopRun()

13 changes: 9 additions & 4 deletions ipykernel/debugger.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,15 @@ async def stackTrace(self, message):
# or only the frames from the notebook.
# We want to remove all the frames from ipykernel when they are present.
try:
sf_list = reply['body']['stackFrames']
module_idx = len(sf_list) - next(i for i, v in enumerate(reversed(sf_list), 1) if v['name'] == '<module>' and i != 1)
reply['body']['stackFrames'] = reply['body']['stackFrames'][:module_idx+1]
sf_list = reply["body"]["stackFrames"]
module_idx = len(sf_list) - next(
i
for i, v in enumerate(reversed(sf_list), 1)
if v["name"] == "<module>" and i != 1
)
reply["body"]["stackFrames"] = reply["body"]["stackFrames"][
: module_idx + 1
]
except StopIteration:
pass
return reply
Expand Down Expand Up @@ -478,4 +484,3 @@ async def process_request(self, message):
self.log.info('The debugger has stopped')

return reply

2 changes: 1 addition & 1 deletion ipykernel/eventloops.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def loop_wx(kernel):

import wx

# Wx uses milliseconds
# Wx uses milliseconds
poll_interval = int(1000 * kernel._poll_interval)

def wake():
Expand Down
20 changes: 15 additions & 5 deletions ipykernel/ipkernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@
_asyncio_runner = None

try:
from IPython.core.completer import rectify_completions as _rectify_completions, provisionalcompleter as _provisionalcompleter
from IPython.core.completer import (
rectify_completions as _rectify_completions,
provisionalcompleter as _provisionalcompleter,
)
_use_experimental_60_completion = True
except ImportError:
_use_experimental_60_completion = False
Expand Down Expand Up @@ -195,9 +198,12 @@ def finish_metadata(self, parent, metadata, reply_content):
"""
# FIXME: remove deprecated ipyparallel-specific code
# This is required by ipyparallel < 5.0
metadata['status'] = reply_content['status']
if reply_content['status'] == 'error' and reply_content['ename'] == 'UnmetDependency':
metadata['dependencies_met'] = False
metadata["status"] = reply_content["status"]
if (
reply_content["status"] == "error"
and reply_content["ename"] == "UnmetDependency"
):
metadata["dependencies_met"] = False

return metadata

Expand Down Expand Up @@ -309,7 +315,11 @@ async def run_cell(*args, **kwargs):
_asyncio_runner
and shell.loop_runner is _asyncio_runner
and asyncio.get_event_loop().is_running()
and should_run_async(code, transformed_cell=transformed_cell, preprocessing_exc_tuple=preprocessing_exc_tuple)
and should_run_async(
code,
transformed_cell=transformed_cell,
preprocessing_exc_tuple=preprocessing_exc_tuple,
)
):
coro = run_cell(
code,
Expand Down
1 change: 0 additions & 1 deletion ipykernel/tests/test_kernelspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,4 +165,3 @@ def test_install_env(tmp_path, env):
assert spec['env'][k] == v
else:
assert 'env' not in spec

2 changes: 1 addition & 1 deletion ipykernel/zmqshell.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ def ask_exit(self):
payload = dict(
source='ask_exit',
keepkernel=self.keepkernel_on_exit,
)
)
self.payload_manager.write_payload(payload)

def run_cell(self, *args, **kwargs):
Expand Down