mirror of
https://github.com/wassname/segpy.git
synced 2026-08-15 12:54:52 +08:00
Relocate four_bytes() from portability to util.
This commit is contained in:
+1
-1
@@ -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
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user