GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — vscode-python/pythonFiles/pyvsc-run-isolated.py at main · sandy081/vscode-python

Expand file tree

/

pyvsc-run-isolated.py

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
32 lines (26 loc) · 900 Bytes
/

pyvsc-run-isolated.py

Copy path

File metadata and controls

32 lines (26 loc) · 900 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
if __name__ != "__main__":
raise Exception("{} cannot be imported".format(__name__))
import os
import os.path
import runpy
import sys
def normalize(path):
return os.path.normcase(os.path.normpath(path))
# We "isolate" the script/module (sys.argv[1]) by removing current working
# directory or '' in sys.path and then sending the target on to runpy.
cwd = normalize(os.getcwd())
sys.path[:] = (p for p in sys.path if p != "" and normalize(p) != cwd)
del sys.argv[0]
module = sys.argv[0]
if module == "-c":
ns = {}
for code in sys.argv[1:]:
exec(code, ns, ns)
elif module.startswith("-"):
raise NotImplementedError(sys.argv)
elif module.endswith(".py"):
runpy.run_path(module, run_name="__main__")
else:
runpy.run_module(module, run_name="__main__", alter_sys=True)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.