Skip to content

Commit

Permalink
misc whitespace and line too long
Browse files Browse the repository at this point in the history
Just to please flake8

Part of the ipython#717 PR-group.
  • Loading branch information
Carreau committed Jul 12, 2021
1 parent b2f1a79 commit 63f826c
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 15 deletions.
2 changes: 1 addition & 1 deletion examples/embedding/ipkernel_qtapp.py
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
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
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
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
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
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
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
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

0 comments on commit 63f826c

Please sign in to comment.