Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
5d8be459
Commit
5d8be459
authored
Oct 15, 1996
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow code objects to be passed to run() and eval().
parent
521cfe92
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
Lib/bdb.py
Lib/bdb.py
+7
-2
No files found.
Lib/bdb.py
View file @
5d8be459
...
...
@@ -7,6 +7,7 @@
# And of course... you can roll your own!
import
sys
import
types
BdbQuit
=
'bdb.BdbQuit'
# Exception to give up completely
...
...
@@ -278,9 +279,11 @@ class Bdb: # Basic Debugger
locals
=
globals
self
.
reset
()
sys
.
settrace
(
self
.
trace_dispatch
)
if
type
(
cmd
)
<>
types
.
CodeType
:
cmd
=
cmd
+
'
\
n
'
try
:
try
:
exec
cmd
+
'
\
n
'
in
globals
,
locals
exec
cmd
in
globals
,
locals
except
BdbQuit
:
pass
finally
:
...
...
@@ -295,9 +298,11 @@ class Bdb: # Basic Debugger
locals
=
globals
self
.
reset
()
sys
.
settrace
(
self
.
trace_dispatch
)
if
type
(
expr
)
<>
types
.
CodeType
:
expr
=
expr
+
'
\
n
'
try
:
try
:
return
eval
(
expr
+
'
\
n
'
,
globals
,
locals
)
return
eval
(
expr
,
globals
,
locals
)
except
BdbQuit
:
pass
finally
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment