mirror of
https://github.com/morluto/rea.git
synced 2026-12-06 14:59:05 +00:00
refactor(python): share marshal string projection (#16385)
This commit is contained in:
1 parent
62c27158c3
commit
51475a6341
2 files changed
+5
-9
No files matched your search
@@ -22,7 +22,6 @@ import { PYTHON_PYC_FORMAT, pythonPycLimit } from "./PythonPyc.errors.js";
|
||||
import { pythonPycBytecodeIdentity } from "./PythonPycBytecodeEquality.js";
|
||||
import {
|
||||
asBytes,
|
||||
asString,
|
||||
asStringWithRaw,
|
||||
asTuple,
|
||||
emptyPythonPycWork,
|
||||
@@ -531,13 +530,16 @@ class PycMarshalReader extends MarshalReader<MarshalValue> {
|
||||
varnames.display.length,
|
||||
);
|
||||
}
|
||||
const filename = asString(this.readObject(depth + 1), "co_filename");
|
||||
const filename = asStringWithRaw(
|
||||
this.readObject(depth + 1),
|
||||
"co_filename",
|
||||
).value;
|
||||
const nameObject = this.readObject(depth + 1);
|
||||
const codeName = asStringWithRaw(nameObject, "co_name");
|
||||
const name = codeName.value;
|
||||
const qualname =
|
||||
this.layout === "py311"
|
||||
? asString(this.readObject(depth + 1), "co_qualname")
|
||||
? asStringWithRaw(this.readObject(depth + 1), "co_qualname").value
|
||||
: null;
|
||||
const firstlineno = this.i32();
|
||||
const linetable = asBytes(this.readObject(depth + 1), "co_linetable");
|
||||
|
||||
Reference in new issue
Block a user