Skip to content

docs: add missing import os in FAQ.md Python code snippet#28220

Open
lingxiu58 wants to merge 1 commit intomicrosoft:mainfrom
lingxiu58:fix/issue-28219-faq-missing-import-os
Open

docs: add missing import os in FAQ.md Python code snippet#28220
lingxiu58 wants to merge 1 commit intomicrosoft:mainfrom
lingxiu58:fix/issue-28219-faq-missing-import-os

Conversation

@lingxiu58
Copy link
Copy Markdown

Summary

Fixes a broken Python code example in docs/FAQ.md.

Problem

The FAQ section "How do I force single threaded execution mode in ORT?" contains a Python snippet that calls os.environ["OMP_NUM_THREADS"] = "1" before importing os. Running this snippet as-is raises:

NameError: name 'os' is not defined

Fix

Added import os on the line immediately before the os.environ call.

Changes

  • docs/FAQ.md: Insert import os before os.environ["OMP_NUM_THREADS"] = "1"

Closes #28219


Signed-off-by: Cocoon-Break 86288566+lingxiu58@users.noreply.github.com

…#28219)

The FAQ.md Python example for forcing single-threaded execution used
os.environ without importing os, which would raise NameError at runtime.

Signed-off-by: Cocoon-Break <86288566+lingxiu58@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: FAQ.md Python snippet missing import os before os.environ call

1 participant