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
8c2ec272
Commit
8c2ec272
authored
Aug 17, 2006
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
If cPickle isn't available, use pickle.
parent
9af561bc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
Lib/logging/handlers.py
Lib/logging/handlers.py
+6
-2
No files found.
Lib/logging/handlers.py
View file @
8c2ec272
...
...
@@ -27,7 +27,11 @@ Copyright (C) 2001-2004 Vinay Sajip. All Rights Reserved.
To use, simply 'import logging' and log away!
"""
import
sys
,
logging
,
socket
,
types
,
os
,
string
,
cPickle
,
struct
,
time
,
glob
import
sys
,
logging
,
socket
,
types
,
os
,
string
,
struct
,
time
,
glob
try
:
import
cPickle
as
pickle
except
ImportError
:
import
pickle
try
:
import
codecs
...
...
@@ -389,7 +393,7 @@ class SocketHandler(logging.Handler):
if
ei
:
dummy
=
self
.
format
(
record
)
# just to get traceback text into record.exc_text
record
.
exc_info
=
None
# to avoid Unpickleable error
s
=
cP
ickle
.
dumps
(
record
.
__dict__
,
1
)
s
=
p
ickle
.
dumps
(
record
.
__dict__
,
1
)
if
ei
:
record
.
exc_info
=
ei
# for next handler
slen
=
struct
.
pack
(
">L"
,
len
(
s
))
...
...
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