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
d732c95e
Commit
d732c95e
authored
Mar 27, 2004
by
Raymond Hettinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert 1.51 booleans so that sre will still run on old pythons.
parent
968c56a6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
Lib/sre_compile.py
Lib/sre_compile.py
+6
-6
No files found.
Lib/sre_compile.py
View file @
d732c95e
...
...
@@ -203,16 +203,16 @@ def _optimize_charset(charset, fixup):
# internal: optimize character set
out
=
[]
outappend
=
out
.
append
charmap
=
[
False
]
*
256
charmap
=
[
0
]
*
256
try
:
for
op
,
av
in
charset
:
if
op
is
NEGATE
:
outappend
((
op
,
av
))
elif
op
is
LITERAL
:
charmap
[
fixup
(
av
)]
=
True
charmap
[
fixup
(
av
)]
=
1
elif
op
is
RANGE
:
for
i
in
range
(
fixup
(
av
[
0
]),
fixup
(
av
[
1
])
+
1
):
charmap
[
i
]
=
True
charmap
[
i
]
=
1
elif
op
is
CATEGORY
:
# XXX: could append to charmap tail
return
charset
# cannot compress
...
...
@@ -298,17 +298,17 @@ def _optimize_unicode(charset, fixup):
import
array
except
ImportError
:
return
charset
charmap
=
[
False
]
*
65536
charmap
=
[
0
]
*
65536
negate
=
0
try
:
for
op
,
av
in
charset
:
if
op
is
NEGATE
:
negate
=
1
elif
op
is
LITERAL
:
charmap
[
fixup
(
av
)]
=
True
charmap
[
fixup
(
av
)]
=
1
elif
op
is
RANGE
:
for
i
in
xrange
(
fixup
(
av
[
0
]),
fixup
(
av
[
1
])
+
1
):
charmap
[
i
]
=
True
charmap
[
i
]
=
1
elif
op
is
CATEGORY
:
# XXX: could expand category
return
charset
# cannot compress
...
...
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