FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
bpython/bpython/debugger.py at debugging-uncaught-exceptions · optionalg/bpython · GitHub
optionalg
/
bpython
Public
forked from
bpython/bpython
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
bpython
/
bpython
/
debugger.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
36 lines (28 loc) · 863 Bytes
Breadcrumbs
bpython
/
bpython
/
debugger.py
Copy path
File metadata and controls
36 lines (28 loc) · 863 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/python2.7
# -*- coding: utf-8 -*-
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
"""
Debugger factory. Set PYTHON_DEBUGGER to a module path that has a post_mortem
function in it. Defaults to bpdb. This allows alternate debuggers to be used,
such as pycopia.debugger. :)
"""
from
__future__
import
absolute_import
from
__future__
import
print_function
from
__future__
import
unicode_literals
from
__future__
import
division
import
os
import
sys
post_mortem
=
None
def
_get_debugger
():
global
post_mortem
modname
=
os
.
environ
.
get
(
"PYTHON_DEBUGGER"
,
"bpdb"
)
__import__
(
modname
)
mod
=
sys
.
modules
[
modname
]
pm
=
getattr
(
mod
,
"post_mortem"
)
if
pm
.
__code__
.
co_argcount
>
2
:
post_mortem
=
pm
else
:
def
_post_mortem
(
t
,
ex
,
exval
):
return
pm
(
t
)
post_mortem
=
_post_mortem
_get_debugger
()
Back
|
FazBrowse Home
|
New Git URL