From 7ed9b2eb6d049420d4de1b54377c8c8d454897fb Mon Sep 17 00:00:00 2001 From: Rossen Georgiev Date: Sun, 21 Jan 2018 17:24:21 +0000 Subject: [PATCH] util.binary: small tweak --- steam/util/binary.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/steam/util/binary.py b/steam/util/binary.py index 43dd7e6..4dd1f68 100644 --- a/steam/util/binary.py +++ b/steam/util/binary.py @@ -1,4 +1,5 @@ -import struct +from struct import unpack_from as _unpack_from, calcsize as _calcsize + class StructReader(object): def __init__(self, data): @@ -53,8 +54,8 @@ class StructReader(object): :return data: result from :func:`struct.unpack_from` :rtype: :class:`tuple` """ - data = struct.unpack_from(format_text, self.data, self.offset) - self.offset += struct.calcsize(format_text) + data = _unpack_from(format_text, self.data, self.offset) + self.offset += _calcsize(format_text) return data def skip(self, n):