Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
SMIRR Jean-Loup
igor
Commits
93014f2b
Commit
93014f2b
authored
Jul 21, 2012
by
W. Trevor King
Browse files
Convert buffer(...) -> bytes(...) for Python 3 compatibility.
parent
d2c87ab4
Changes
2
Hide whitespace changes
Inline
Side-by-side
igor/binarywave.py
View file @
93014f2b
...
...
@@ -82,10 +82,10 @@ class StaticStringField (_DynamicField):
if
end
>
start
:
strings
.
append
(
d
[
start
:
end
])
if
self
.
_null_terminated
:
strings
[
-
1
]
=
strings
[
-
1
].
split
(
'
\x00
'
,
1
)[
0
]
strings
[
-
1
]
=
strings
[
-
1
].
split
(
b
'
\x00
'
,
1
)[
0
]
start
=
end
elif
self
.
_null_terminated
:
d
=
d
.
split
(
'
\x00
'
,
1
)[
0
]
d
=
d
.
split
(
b
'
\x00
'
,
1
)[
0
]
return
d
...
...
igor/packed.py
View file @
93014f2b
...
...
@@ -67,7 +67,7 @@ def load(filename, strict=True, ignore_unknown=True):
while
True
:
PackedFileRecordHeader
.
byte_order
=
initial_byte_order
PackedFileRecordHeader
.
setup
()
b
=
b
uffer
(
f
.
read
(
PackedFileRecordHeader
.
size
))
b
=
b
ytes
(
f
.
read
(
PackedFileRecordHeader
.
size
))
if
not
b
:
break
if
len
(
b
)
<
PackedFileRecordHeader
.
size
:
...
...
@@ -88,7 +88,7 @@ def load(filename, strict=True, ignore_unknown=True):
header
=
PackedFileRecordHeader
.
unpack_from
(
b
)
_LOG
.
debug
(
'reordered version: {}'
.
format
(
header
[
'version'
]))
data
=
b
uffer
(
f
.
read
(
header
[
'numDataBytes'
]))
data
=
b
ytes
(
f
.
read
(
header
[
'numDataBytes'
]))
if
len
(
data
)
<
header
[
'numDataBytes'
]:
raise
ValueError
(
(
'not enough data for the next record ({} < {})'
...
...
Write
Preview
Supports
Markdown
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