X Tutup
Skip to content

Commit 1e27e5c

Browse files
committed
small bit of code clean-up
1 parent 02f6336 commit 1e27e5c

File tree

2 files changed

+13
-16
lines changed

2 files changed

+13
-16
lines changed

bpdb/__init__.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@
2020
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2121
# THE SOFTWARE.
2222

23+
import sys
2324

2425
import bpython
26+
from bpdb.debugger import BPdb
2527

2628

2729
__version__ = bpython.__version__
@@ -30,9 +32,5 @@
3032
def set_trace():
3133
""" Just like pdb.set_trace(), a helper function that creates
3234
a debugger instance and sets the trace. """
33-
import sys
34-
from bpdb.debugger import BPdb
35-
BPdb().set_trace(sys._getframe().f_back)
36-
37-
38-
go = set_trace
35+
debugger = BPdb()
36+
debugger.set_trace(sys._getframe().f_back)

bpdb/debugger.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
class BPdb(pdb.Pdb):
2828
""" PDB with BPython support. """
29-
29+
3030
def __init__(self):
3131
pdb.Pdb.__init__(self)
3232
self.rcLines = []
@@ -36,18 +36,17 @@ def __init__(self):
3636
### cmd.Cmd commands
3737

3838

39-
def do_BPython(self, arg):
39+
def do_Bpython(self, arg):
4040
bpython.embed(self.curframe.f_locals, ['-i'])
4141

4242

43-
def help_BPython(self):
44-
print >>self.stdout, "B(Python)"
45-
print >>self.stdout, """Invoke the BPython interpreter for this
46-
stack frame. To exit BPython and return to BPdb type in CTRL+D
47-
(CTRL+Z on Windows)."""
43+
def help_Bpython(self):
44+
print "B(python)"
45+
print
46+
print ("Invoke the bpython interpreter for this stack frame. To exit "
47+
"bpython and return to a standard pdb press Ctrl-d")
4848

4949

5050
### shortcuts
51-
52-
do_B = do_BPython
53-
help_B = help_BPython
51+
do_B = do_Bpython
52+
help_B = help_Bpython

0 commit comments

Comments
 (0)
X Tutup