[pypy-svn] r16289 - pypy/dist/pypy/module/_sre
nik at codespeak.net
nik at codespeak.net
Tue Aug 23 17:16:28 CEST 2005
Author: nik
Date: Tue Aug 23 17:16:27 2005
New Revision: 16289
Modified:
pypy/dist/pypy/module/_sre/interp_sre.py
Log:
one more fix. this version now annotates fine. still needs to be tested on
a full translation.
Modified: pypy/dist/pypy/module/_sre/interp_sre.py
==============================================================================
--- pypy/dist/pypy/module/_sre/interp_sre.py (original)
+++ pypy/dist/pypy/module/_sre/interp_sre.py Tue Aug 23 17:16:27 2005
@@ -4,6 +4,9 @@
from pypy.interpreter.typedef import GetSetProperty, TypeDef
from pypy.interpreter.gateway import interp2app
+import sys
+BIG_ENDIAN = sys.byteorder == "big"
+
#### Exposed functions
# XXX can we import those safely from sre_constants?
@@ -324,7 +327,6 @@
return space.newbool(False)
function = set_dispatch_table[opcode]
result = function(space, context, char_code)
- print result
return space.newbool(result == MatchContext.OK)
def set_failure(space, ctx, char_code):
@@ -401,12 +403,11 @@
def to_byte_array(int_value):
"""Creates a list of bytes out of an integer representing data that is
CODESIZE bytes wide."""
- import sys
byte_array = [0] * CODESIZE
for i in range(CODESIZE):
byte_array[i] = int_value & 0xff
int_value = int_value >> 8
- if sys.byteorder == "big":
+ if BIG_ENDIAN:
# Uhm, maybe there's a better way to reverse lists
byte_array_reversed = [0] * CODESIZE
for i in range(CODESIZE):
More information about the Pypy-commit
mailing list