##// END OF EJS Templates
Summary of changes:...
Doug Blank -
Show More
@@ -43,12 +43,12 b' import time'
43 43
44 44 # Roughtly equal to PyCF_MASK | PyCF_MASK_OBSOLETE as defined in pythonrun.h,
45 45 # this is used as a bitmask to extract future-related code flags.
46 PyCF_MASK = functools.reduce(operator.or_,
47 (getattr(__future__, fname).compiler_flag
48 for fname in __future__.all_feature_names
49 if (hasattr(__future__, fname) and
50 hasattr(getattr(__future__, fname), "compiler_flag"))),
51 0)
46 try:
47 PyCF_MASK = functools.reduce(operator.or_,
48 (getattr(__future__, fname).compiler_flag
49 for fname in __future__.all_feature_names))
50 except AttributeError: # IronPython __future__'s are non-standard, 2/8/2014
51 PyCF_MASK = 0
52 52
53 53 #-----------------------------------------------------------------------------
54 54 # Local utilities
@@ -66,10 +66,7 b' Notes:'
66 66 # Imports
67 67 #-----------------------------------------------------------------------------
68 68
69 try:
70 import __main__
71 except ImportError:
72 pass
69 import __main__
73 70 import glob
74 71 import inspect
75 72 import itertools
@@ -148,6 +148,8 b' USER = py3compat.str_to_unicode(os.environ.get("USER",\'\'))'
148 148 HOSTNAME = py3compat.str_to_unicode(socket.gethostname())
149 149 HOSTNAME_SHORT = HOSTNAME.split(".")[0]
150 150
151 # IronPython doesn't currently have os.getuid() even if
152 # os.name == 'posix'; 2/8/2014
151 153 ROOT_SYMBOL = "#" if (os.name=='nt' or sys.platform=='cli' or os.getuid()==0) else "$"
152 154
153 155 prompt_abbreviations = {
@@ -139,7 +139,10 b' class FunctionMaker(object):'
139 139 func.__defaults__ = getattr(self, 'defaults', ())
140 140 func.__kwdefaults__ = getattr(self, 'kwonlydefaults', None)
141 141 func.__annotations__ = getattr(self, 'annotations', None)
142 callermodule = sys._getframe(3).f_globals.get('__name__', '?')
142 try:
143 callermodule = sys._getframe(3).f_globals.get('__name__', '?')
144 except AttributeError: # IronPython _getframe only exists with FullFrames
145 callermodule = '?'
143 146 func.__module__ = getattr(self, 'module', callermodule)
144 147 func.__dict__.update(kw)
145 148
@@ -18,7 +18,7 b' try:'
18 18 import ctypes
19 19 except ImportError:
20 20 ctypes = None
21 except SystemError:
21 except SystemError: # IronPython issue, 2/8/2014
22 22 ctypes = None
23 23 import os
24 24 import sys
@@ -21,8 +21,7 b' from ._process_common import arg_split'
21 21
22 22 def _find_cmd(cmd):
23 23 """Find the full path to a command using which."""
24 os_path_sep = ":" if os.name == "posix" else ";"
25 paths = System.Environment.GetEnvironmentVariable("PATH").Split(os_path_sep)
24 paths = System.Environment.GetEnvironmentVariable("PATH").Split(os.pathsep)
26 25 for path in paths:
27 26 filename = os.path.join(path, cmd)
28 27 if System.IO.File.Exists(filename):
General Comments 0
You need to be logged in to leave comments. Login now