Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gwenaël Samain
cython
Commits
bb4f0a9c
Commit
bb4f0a9c
authored
6 years ago
by
Jeroen Demeyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use NamedTemporaryFile instead of mkstemp
parent
5af807ff
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
Cython/Debugger/libpython.py
Cython/Debugger/libpython.py
+4
-6
No files found.
Cython/Debugger/libpython.py
View file @
bb4f0a9c
...
...
@@ -1941,7 +1941,6 @@ PyLocals()
##################################################################
import re
import atexit
import warnings
import tempfile
import textwrap
...
...
@@ -2023,14 +2022,13 @@ class _LoggingState(object):
"""
def __init__(self):
self.fd, self.filename = tempfile.mkstemp()
self.file = os.fdopen(self.fd, 'r+')
f = tempfile.NamedTemporaryFile('r+')
self.file = f
self.filename = f.name
self.fd = f.fileno()
_execute("
set
logging
file
%
s
" % self.filename)
self.file_position_stack = []
atexit.register(os.close, self.fd)
atexit.register(os.remove, self.filename)
def __enter__(self):
if not self.file_position_stack:
_execute("
set
logging
redirect
on
")
...
...
This diff is collapsed.
Click to expand it.
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