diff --git a/construct/core.py b/construct/core.py index e5f433a6..4631d543 100644 --- a/construct/core.py +++ b/construct/core.py @@ -960,6 +960,8 @@ def _emitbuild(self, code): return f"(io.write(obj), obj)[1]" def _emitfulltype(self, ksy, bitwise): + if isinstance(self.length, Path): + return dict(size=str(self.length).replace('this[\'', '').replace('\']', '')) return dict(size=self.length)