Repository: ipython/ipython

Issue:
IPython %debug deprecation warning
The following code results in an exception on IPython 5.3

```IPython 5.3.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: import warnings; warnings.simplefilter('error')

In [2]: assert False
---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
<ipython-input-2-6e6df518a476> in <module>()
----> 1 assert False

AssertionError: 

In [3]: %debug
---------------------------------------------------------------------------
DeprecationWarning                        Traceback (most recent call last)
```

Full stack trace:
```
In [3]: %debug
---------------------------------------------------------------------------
DeprecationWarning                        Traceback (most recent call last)
<ipython-input-3-fe3bb68c9ebd> in <module>()
----> 1 get_ipython().magic(u'debug')

/Users/pdm/anaconda/envs/prod_env0911B/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc in magic(self, arg_s)
   2156         magic_name, _, magic_arg_s = arg_s.partition(' ')
   2157         magic_name = magic_name.lstrip(prefilter.ESC_MAGIC)
-> 2158         return self.run_line_magic(magic_name, magic_arg_s)
   2159 
   2160     #-------------------------------------------------------------------------

/Users/pdm/anaconda/envs/prod_env0911B/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc in run_line_magic(self, magic_name, line)
   2077                 kwargs['local_ns'] = sys._getframe(stack_depth).f_locals
   2078             with self.builtin_trap:
-> 2079                 result = fn(*args,**kwargs)
   2080             return result
   2081 

<decorator-gen-55> in debug(self, line, cell)

/Users/pdm/anaconda/envs/prod_env0911B/lib/python2.7/site-packages/IPython/core/magic.pyc in <lambda>(f, *a, **k)
    186     # but it's overkill for just that one bit of state.
    187     def magic_deco(arg):
--> 188         call = lambda f, *a, **k: f(*a, **k)
    189 
    190         if callable(arg):

/Users/pdm/anaconda/envs/prod_env0911B/lib/python2.7/site-packages/IPython/core/magics/execution.pyc in debug(self, line, cell)
    426 
    427         if not (args.breakpoint or args.statement or cell):
--> 428             self._debug_post_mortem()
    429         else:
    430             code = "\n".join(args.statement)

/Users/pdm/anaconda/envs/prod_env0911B/lib/python2.7/site-packages/IPython/core/magics/execution.pyc in _debug_post_mortem(self)
    434 
    435     def _debug_post_mortem(self):
--> 436         self.shell.debugger(force=True)
    437 
    438     def _debug_exec(self, code, breakpoint):

/Users/pdm/anaconda/envs/prod_env0911B/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc in debugger(self, force)
    978             return
    979 
--> 980         self.InteractiveTB.debugger(force=True)
    981 
    982     #-------------------------------------------------------------------------

/Users/pdm/anaconda/envs/prod_env0911B/lib/python2.7/site-packages/IPython/core/ultratb.pyc in debugger(self, force)
   1229             if self.pdb is None:
   1230                 self.pdb = self.debugger_cls(
-> 1231                     self.color_scheme_table.active_scheme_name)
   1232             # the system displayhook may have changed, restore the original
   1233             # for pdb

/Users/pdm/anaconda/envs/prod_env0911B/lib/python2.7/site-packages/IPython/terminal/debugger.pyc in __init__(self, *args, **kwargs)
     22 class TerminalPdb(Pdb):
     23     def __init__(self, *args, **kwargs):
---> 24         Pdb.__init__(self, *args, **kwargs)
     25         self._ptcomp = None
     26         self.pt_init()

/Users/pdm/anaconda/envs/prod_env0911B/lib/python2.7/site-packages/IPython/core/debugger.pyc in __init__(self, color_scheme, completekey, stdin, stdout, context)
    241             warnings.warn(
    242                 "The `color_scheme` argument is deprecated since version 5.1",
--> 243                 DeprecationWarning)
    244         else:
    245             color_scheme = self.shell.colors

DeprecationWarning: The `color_scheme` argument is deprecated since version 5.1


```


Discussion:

Resolving patch:
diff --git a/IPython/core/ultratb.py b/IPython/core/ultratb.py
--- a/IPython/core/ultratb.py
+++ b/IPython/core/ultratb.py
@@ -1227,8 +1227,7 @@ def debugger(self, force=False):
 
         if force or self.call_pdb:
             if self.pdb is None:
-                self.pdb = self.debugger_cls(
-                    self.color_scheme_table.active_scheme_name)
+                self.pdb = self.debugger_cls()
             # the system displayhook may have changed, restore the original
             # for pdb
             display_trap = DisplayTrap(hook=sys.__displayhook__)


Test patch: