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
88b05883
Commit
88b05883
authored
Mar 10, 2008
by
Neal Norwitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
strxfrm and strcoll are conditionally defined, alwsy provide some impl
parent
1804b2c0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
11 deletions
+17
-11
Lib/locale.py
Lib/locale.py
+17
-11
No files found.
Lib/locale.py
View file @
88b05883
...
...
@@ -26,6 +26,18 @@ __all__ = ["getlocale", "getdefaultlocale", "getpreferredencoding", "Error",
"normalize"
,
"LC_CTYPE"
,
"LC_COLLATE"
,
"LC_TIME"
,
"LC_MONETARY"
,
"LC_NUMERIC"
,
"LC_ALL"
,
"CHAR_MAX"
]
def
_strcoll
(
a
,
b
):
""" strcoll(string,string) -> int.
Compares two strings according to the locale.
"""
return
cmp
(
a
,
b
)
def
_strxfrm
(
s
):
""" strxfrm(string) -> string.
Returns a string that behaves for cmp locale-aware.
"""
return
s
try
:
from
_locale
import
*
...
...
@@ -76,17 +88,11 @@ except ImportError:
raise
Error
(
'_locale emulation only supports "C" locale'
)
return
'C'
def
strcoll
(
a
,
b
):
""" strcoll(string,string) -> int.
Compares two strings according to the locale.
"""
return
cmp
(
a
,
b
)
def
strxfrm
(
s
):
""" strxfrm(string) -> string.
Returns a string that behaves for cmp locale-aware.
"""
return
s
# These may or may not exist in _locale, so be sure to set them.
if
'strxfrm'
not
in
globals
():
strxfrm
=
_strxfrm
if
'strcoll'
not
in
globals
():
strcoll
=
_strcoll
### Number formatting APIs
...
...
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