Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(8)

Side by Side Diff: Lib/distutils/core.py

Issue 10639: reindent.py converts newlines to platform default
Patch Set: Created 8 years, 8 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Lib/ctypes/test/test_byteswap.py ('k') | Lib/distutils/spawn.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 """distutils.core 1 """distutils.core
2 2
3 The only module that needs to be imported to use the Distutils; provides 3 The only module that needs to be imported to use the Distutils; provides
4 the 'setup' function (which is to be called from the setup script). Also 4 the 'setup' function (which is to be called from the setup script). Also
5 indirectly provides the Distribution and Command classes, although they are 5 indirectly provides the Distribution and Command classes, although they are
6 really defined in distutils.dist and distutils.cmd. 6 really defined in distutils.dist and distutils.cmd.
7 """ 7 """
8 8
9 __revision__ = "$Id$" 9 __revision__ = "$Id$"
10 10
11 import os 11 import sys, os
12 import sys
13 12
14 from distutils.debug import DEBUG 13 from distutils.debug import DEBUG
15 from distutils.errors import * 14 from distutils.errors import *
16 from distutils.util import grok_environment_error 15 from distutils.util import grok_environment_error
17 16
18 # Mainly import these so setup scripts can "from distutils.core import" them. 17 # Mainly import these so setup scripts can "from distutils.core import" them.
19 from distutils.dist import Distribution 18 from distutils.dist import Distribution
20 from distutils.cmd import Command 19 from distutils.cmd import Command
21 from distutils.config import PyPIRCCommand 20 from distutils.config import PyPIRCCommand
22 from distutils.extension import Extension 21 from distutils.extension import Extension
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 _setup_stop_after = stop_after 208 _setup_stop_after = stop_after
210 209
211 save_argv = sys.argv 210 save_argv = sys.argv
212 g = {'__file__': script_name} 211 g = {'__file__': script_name}
213 l = {} 212 l = {}
214 try: 213 try:
215 try: 214 try:
216 sys.argv[0] = script_name 215 sys.argv[0] = script_name
217 if script_args is not None: 216 if script_args is not None:
218 sys.argv[1:] = script_args 217 sys.argv[1:] = script_args
219 with open(script_name, 'rb') as f: 218 f = open(script_name)
219 try:
220 exec(f.read(), g, l) 220 exec(f.read(), g, l)
221 finally:
222 f.close()
221 finally: 223 finally:
222 sys.argv = save_argv 224 sys.argv = save_argv
223 _setup_stop_after = None 225 _setup_stop_after = None
224 except SystemExit: 226 except SystemExit:
225 # Hmm, should we do something if exiting with a non-zero code 227 # Hmm, should we do something if exiting with a non-zero code
226 # (ie. error)? 228 # (ie. error)?
227 pass 229 pass
228 except: 230 except:
229 raise 231 raise
230 232
231 if _setup_distribution is None: 233 if _setup_distribution is None:
232 raise RuntimeError(("'distutils.core.setup()' was never called -- " 234 raise RuntimeError(("'distutils.core.setup()' was never called -- "
233 "perhaps '%s' is not a Distutils setup script?") % \ 235 "perhaps '%s' is not a Distutils setup script?") % \
234 script_name) 236 script_name)
235 237
236 # I wonder if the setup script's namespace -- g and l -- would be of 238 # I wonder if the setup script's namespace -- g and l -- would be of
237 # any interest to callers? 239 # any interest to callers?
238 #print "_setup_distribution:", _setup_distribution 240 #print "_setup_distribution:", _setup_distribution
239 return _setup_distribution 241 return _setup_distribution
240 242
241 # run_setup () 243 # run_setup ()
OLDNEW
« no previous file with comments | « Lib/ctypes/test/test_byteswap.py ('k') | Lib/distutils/spawn.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+