Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(224)

Side by Side Diff: third_party/google-endpoints/setuptools/launch.py

Issue 2666783008: Add google-endpoints to third_party/. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 """
2 Launch the Python script on the command line after
3 setuptools is bootstrapped via import.
4 """
5
6 # Note that setuptools gets imported implicitly by the
7 # invocation of this script using python -m setuptools.launch
8
9 import tokenize
10 import sys
11
12
13 def run():
14 """
15 Run the script in sys.argv[1] as if it had
16 been invoked naturally.
17 """
18 __builtins__
19 script_name = sys.argv[1]
20 namespace = dict(
21 __file__=script_name,
22 __name__='__main__',
23 __doc__=None,
24 )
25 sys.argv[:] = sys.argv[1:]
26
27 open_ = getattr(tokenize, 'open', open)
28 script = open_(script_name).read()
29 norm_script = script.replace('\\r\\n', '\\n')
30 code = compile(norm_script, script_name, 'exec')
31 exec(code, namespace)
32
33
34 if __name__ == '__main__':
35 run()
OLDNEW
« no previous file with comments | « third_party/google-endpoints/setuptools/gui-64.exe ('k') | third_party/google-endpoints/setuptools/lib2to3_ex.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698