##// END OF EJS Templates
Tidy up error raising in magic decorators....
Thomas Kluyver -
Show More
@@ -203,7 +203,7 b' def _method_magic_marker(magic_kind):'
203 203 return decorator(call, func)
204 204 retval = mark
205 205 else:
206 raise ValueError("Decorator can only be called with "
206 raise TypeError("Decorator can only be called with "
207 207 "string or function")
208 208 return retval
209 209
@@ -229,7 +229,8 b' def _function_magic_marker(magic_kind):'
229 229 if get_ipython is not None:
230 230 break
231 231 else:
232 raise('Decorator can only run in context where `get_ipython` exists')
232 raise NameError('Decorator can only run in context where '
233 '`get_ipython` exists')
233 234
234 235 ip = get_ipython()
235 236
@@ -247,7 +248,7 b' def _function_magic_marker(magic_kind):'
247 248 return decorator(call, func)
248 249 retval = mark
249 250 else:
250 raise ValueError("Decorator can only be called with "
251 raise TypeError("Decorator can only be called with "
251 252 "string or function")
252 253 return retval
253 254
General Comments 0
You need to be logged in to leave comments. Login now