Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
persistent
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
Kirill Smelkov
persistent
Commits
a83f388b
Commit
a83f388b
authored
Jun 29, 2012
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Py3k: repr() must get a native string.
parent
d492ea2e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
persistent/_compat.py
persistent/_compat.py
+10
-0
persistent/timestamp.py
persistent/timestamp.py
+2
-1
No files found.
persistent/_compat.py
View file @
a83f388b
...
...
@@ -22,6 +22,11 @@ if sys.version_info[0] > 2: #pragma NO COVER
def
_u
(
s
):
return
s
def
_native
(
s
):
if
isinstance
(
s
,
bytes
):
return
s
.
decode
(
'unicode_escape'
)
return
s
PYTHON3
=
True
PYTHON2
=
False
...
...
@@ -33,5 +38,10 @@ else: #pragma NO COVER
def
_u
(
s
):
return
unicode
(
s
,
'unicode_escape'
)
def
_native
(
s
):
if
isinstance
(
s
,
unicode
):
return
s
.
encode
(
'unicode_escape'
)
return
s
PYTHON3
=
False
PYTHON2
=
True
persistent/timestamp.py
View file @
a83f388b
...
...
@@ -18,6 +18,7 @@ import math
import
struct
import
sys
from
persistent._compat
import
_native
_RAWTYPE
=
bytes
...
...
@@ -89,7 +90,7 @@ class pyTimeStamp(object):
return
self
.
_raw
def
__repr__
(
self
):
return
self
.
_raw
return
_native
(
self
.
_raw
)
def
year
(
self
):
return
self
.
_elements
[
0
]
...
...
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