Relocate four_bytes() from portability to util.

This commit is contained in:
Robert Smallshire
2015-05-05 13:33:48 +02:00
parent 6e3494586a
commit b90ff07940
3 changed files with 6 additions and 13 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
from math import frexp, isnan, isinf, ceil, floor, trunc
from numbers import Real
from segpy.portability import four_bytes
from segpy.util import four_bytes
-12
View File
@@ -4,18 +4,6 @@ import sys
EMPTY_BYTE_STRING = b'' if sys.version_info >= (3, 0) else ''
if sys.version_info >= (3, 0):
def four_bytes(byte_str):
a, b, c, d = byte_str[:4]
return a, b, c, d
else:
def four_bytes(byte_str):
a = ord(byte_str[0])
b = ord(byte_str[1])
c = ord(byte_str[2])
d = ord(byte_str[3])
return a, b, c, d
if sys.version_info >= (3, 0):
unicode = str
else:
+5
View File
@@ -319,3 +319,8 @@ def super_class(cls):
def flatten(sequence_of_sequences):
return chain.from_iterable(sequence_of_sequences)
def four_bytes(byte_str):
a, b, c, d = byte_str[:4]
return a, b, c, d