◐ Shell
reader mode source ↗
Skip to content
Merged
Hide file tree
Changes from all commits
File filter
Conversations
Jump to
Diff view
Apply and reload
Show whitespace
Diff view
Apply and reload
66 changes: 64 additions & 2 deletions vm/src/stdlib/sys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ mod sys {
ascii,
hash::{PyHash, PyUHash},
},
frame::FrameRef,
function::{FuncArgs, OptionalArg, PosArgs},
stdlib::builtins,
stdlib::warnings::warn,
types::PyStructSequence,
version,
vm::{Settings, VirtualMachine},
Expand Down Expand Up @@ -706,6 +706,68 @@ mod sys {
crate::vm::thread::COROUTINE_ORIGIN_TRACKING_DEPTH.with(|cell| cell.get()) as _
}

/// sys.flags
///
/// Flags provided through command line arguments or environment vars.
Expand Down
4 changes: 3 additions & 1 deletion vm/src/vm/thread.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{AsObject, PyObject, VirtualMachine};
use itertools::Itertools;
use std::{
cell::{Cell, RefCell},
Expand All @@ -11,6 +11,8 @@ thread_local! {
static VM_CURRENT: RefCell<*const VirtualMachine> = std::ptr::null::<VirtualMachine>().into();

pub(crate) static COROUTINE_ORIGIN_TRACKING_DEPTH: Cell<u32> = const { Cell::new(0) };
}

pub fn with_current_vm<R>(f: impl FnOnce(&VirtualMachine) -> R) -> R {
Expand Down
Toggle all file notes Toggle all file annotations