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

Skip to content

Commit cbdbaf5

Browse files
committed
explicit allow_none
1 parent ffae03e commit cbdbaf5

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

IPython/core/shellapp.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,15 +184,15 @@ def _extra_extension_changed(self, name, old, new):
184184
module_to_run = Unicode('', config=True,
185185
help="Run the module as a script."
186186
)
187-
gui = CaselessStrEnum(gui_keys, config=True,
187+
gui = CaselessStrEnum(gui_keys, config=True, allow_none=True,
188188
help="Enable GUI event loop integration with any of {0}.".format(gui_keys)
189189
)
190-
matplotlib = CaselessStrEnum(backend_keys,
190+
matplotlib = CaselessStrEnum(backend_keys, allow_none=True,
191191
config=True,
192192
help="""Configure matplotlib for interactive use with
193193
the default matplotlib backend."""
194194
)
195-
pylab = CaselessStrEnum(backend_keys,
195+
pylab = CaselessStrEnum(backend_keys, allow_none=True,
196196
config=True,
197197
help="""Pre-load matplotlib and numpy for interactive use,
198198
selecting a particular matplotlib backend and loop integration.

IPython/kernel/tests/test_message_spec.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def _data_changed(self, name, old, new):
106106

107107
class ExecuteReply(Reference):
108108
execution_count = Integer()
109-
status = Enum((u'ok', u'error'))
109+
status = Enum((u'ok', u'error'), allow_none=True)
110110

111111
def check(self, d):
112112
Reference.check(self, d)
@@ -139,7 +139,7 @@ class ArgSpec(Reference):
139139

140140

141141
class Status(Reference):
142-
execution_state = Enum((u'busy', u'idle', u'starting'))
142+
execution_state = Enum((u'busy', u'idle', u'starting'), allow_none=True)
143143

144144

145145
class CompleteReply(Reference):
@@ -165,7 +165,7 @@ def check(self, d):
165165

166166

167167
class IsCompleteReply(Reference):
168-
status = Enum((u'complete', u'incomplete', u'invalid', u'unknown'))
168+
status = Enum((u'complete', u'incomplete', u'invalid', u'unknown'), allow_none=True)
169169

170170
def check(self, d):
171171
Reference.check(self, d)
@@ -187,7 +187,7 @@ class ExecuteInput(Reference):
187187

188188

189189
class Stream(Reference):
190-
name = Enum((u'stdout', u'stderr'))
190+
name = Enum((u'stdout', u'stderr'), allow_none=True)
191191
text = Unicode()
192192

193193

IPython/terminal/console/interactiveshell.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class ZMQTerminalInteractiveShell(TerminalInteractiveShell):
5050
)
5151

5252
image_handler = Enum(('PIL', 'stream', 'tempfile', 'callable'),
53-
config=True, help=
53+
config=True, allow_none=True, help=
5454
"""
5555
Handler for image type output. This is useful, for example,
5656
when connecting to the kernel in which pylab inline backend is

0 commit comments

Comments
 (0)