Changeset 10 for python/trunk/Lib
- Timestamp:
- Sep 3, 2010, 5:33:06 PM (15 years ago)
- Location:
- python/trunk/Lib
- Files:
-
- 1 added
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
python/trunk/Lib/bsddb/dbshelve.py
r2 r10 1 #!/ bin/env python1 #!/usr/bin/env python 2 2 #------------------------------------------------------------------------ 3 3 # Copyright (c) 1997-2001 by Total Control Software -
python/trunk/Lib/cgi.py
r2 r10 1 #! /usr/local/bin/python1 #!/usr/bin/python 2 2 3 3 # NOTE: the above "/usr/local/bin/python" is NOT a mistake. It is -
python/trunk/Lib/distutils/ccompiler.py
r2 r10 983 983 # compiler 984 984 ('cygwin.*', 'unix'), 985 ('os2knix', 'emx'), 985 986 ('os2emx', 'emx'), 986 987 -
python/trunk/Lib/distutils/command/bdist_rpm.py
r2 r10 200 200 "--python and --fix-python are mutually exclusive options" 201 201 202 if os.name != 'posix' :202 if os.name != 'posix' and os.name != 'os2': 203 203 raise DistutilsPlatformError, \ 204 204 ("don't know how to create RPM " … … 323 323 rpm_cmd = ['rpm'] 324 324 if os.path.exists('/usr/bin/rpmbuild') or \ 325 os.path.exists('/usr/bin/rpmbuild.exe') or \ 325 326 os.path.exists('/bin/rpmbuild'): 326 327 rpm_cmd = ['rpmbuild'] … … 346 347 q_cmd = r"rpm -q --qf '%s %s\n' --specfile '%s'" % ( 347 348 src_rpm, non_src_rpm, spec_path) 349 if os.name == 'os2': 350 q_cmd = q_cmd.replace( '%{', '%%{') 348 351 349 352 out = os.popen(q_cmd) -
python/trunk/Lib/distutils/command/install.py
r2 r10 284 284 285 285 # Next, stuff that's wrong (or dubious) only on certain platforms. 286 if os.name != "posix" :286 if os.name != "posix" and os.name != "os2": 287 287 if self.exec_prefix: 288 288 self.warn("exec-prefix option ignored on this platform") … … 299 299 self.dump_dirs("pre-finalize_{unix,other}") 300 300 301 if os.name == 'posix' :301 if os.name == 'posix' or os.name == "os2": 302 302 self.finalize_unix() 303 303 else: -
python/trunk/Lib/distutils/emxccompiler.py
r2 r10 64 64 # Hard-code GCC because that's what this is all about. 65 65 # XXX optimization, warnings etc. should be customizable. 66 self.set_executables(compiler='gcc - Zomf -Zmt -O3 -fomit-frame-pointer -mprobe-Wall',67 compiler_so='gcc - Zomf -Zmt -O3 -fomit-frame-pointer -mprobe-Wall',68 linker_exe='gcc -Zomf -Z mt -Zcrtdll',69 linker_so='gcc -Zomf -Z mt -Zcrtdll -Zdll')66 self.set_executables(compiler='gcc -g -O2 -march=i386 -mtune=i686 -fomit-frame-pointer -Wall', 67 compiler_so='gcc -g -O2 -march=i386 -mtune=i686 -fomit-frame-pointer -Wall', 68 linker_exe='gcc -Zomf -Zexe', 69 linker_so='gcc -Zomf -Zdll') 70 70 71 71 # want the gcc library statically linked (so that we don't have … … 139 139 "EXPORTS"] 140 140 for sym in export_symbols: 141 contents.append(' " %s"' % sym)141 contents.append(' "_%s"' % sym) 142 142 self.execute(write_file, (def_file, contents), 143 143 "writing %s" % def_file) … … 209 209 # to deal with file naming/searching differences 210 210 def find_library_file(self, dirs, lib, debug=0): 211 shortlib = '%s.lib' % lib 212 longlib = 'lib%s.lib' % lib # this form very rare 211 try_names = [lib + ".lib", lib + ".a", "lib" + lib + ".lib", "lib" + lib + ".a"] 213 212 214 213 # get EMX's default library directory search path … … 218 217 emx_dirs = [] 219 218 219 #print "dirs:",dirs 220 220 for dir in dirs + emx_dirs: 221 shortlibp = os.path.join(dir, shortlib) 222 longlibp = os.path.join(dir, longlib) 223 if os.path.exists(shortlibp): 224 return shortlibp 225 elif os.path.exists(longlibp): 226 return longlibp 221 for name in try_names: 222 libfile = os.path.join(dir, name) 223 #print "libfile:",libfile 224 if os.path.exists(libfile): 225 return libfile 227 226 228 227 # Oops, didn't find it in *any* of 'dirs' -
python/trunk/Lib/distutils/sysconfig.py
r2 r10 91 91 return os.path.join(prefix, "Include") 92 92 elif os.name == "os2": 93 return os.path.join(prefix, "Include") 93 if python_build: 94 base = os.path.dirname(os.path.abspath(sys.executable)) 95 if plat_specific: 96 inc_dir = base 97 else: 98 inc_dir = os.path.join(base, "Include") 99 if not os.path.exists(inc_dir): 100 inc_dir = os.path.join(os.path.dirname(base), "Include") 101 return inc_dir 102 return os.path.join(prefix, "include", "python" + get_python_version()) 94 103 else: 95 104 raise DistutilsPlatformError( … … 145 154 146 155 elif os.name == "os2": 156 libpython = os.path.join(prefix, 157 "lib", "python" + get_python_version()) 147 158 if standard_lib: 148 return os.path.join(prefix, "Lib")149 else: 150 return os.path.join( prefix, "Lib", "site-packages")159 return libpython 160 else: 161 return os.path.join(libpython, "site-packages") 151 162 152 163 else: … … 491 502 """Initialize the module as appropriate for OS/2""" 492 503 g = {} 504 # load the installed Makefile: 505 try: 506 filename = get_makefile_filename() 507 parse_makefile(filename, g) 508 except IOError, msg: 509 my_msg = "invalid Python installation: unable to open %s" % filename 510 if hasattr(msg, "strerror"): 511 my_msg = my_msg + " (%s)" % msg.strerror 512 513 raise DistutilsPlatformError(my_msg) 514 515 # load the installed pyconfig.h: 516 try: 517 filename = get_config_h_filename() 518 parse_config_h(file(filename), g) 519 except IOError, msg: 520 my_msg = "invalid Python installation: unable to open %s" % filename 521 if hasattr(msg, "strerror"): 522 my_msg = my_msg + " (%s)" % msg.strerror 523 524 raise DistutilsPlatformError(my_msg) 525 526 # On AIX, there are wrong paths to the linker scripts in the Makefile 527 # -- these paths are relative to the Python source, but when installed 528 # the scripts are in another directory. 529 if python_build: 530 g['LDSHARED'] = g['BLDSHARED'] 531 532 # OS/2 module 533 493 534 # set basic install directories 494 535 g['LIBDEST'] = get_python_lib(plat_specific=0, standard_lib=1) -
python/trunk/Lib/distutils/unixccompiler.py
r2 r10 140 140 dylib_lib_extension = ".dylib" 141 141 static_lib_format = shared_lib_format = dylib_lib_format = "lib%s%s" 142 if sys.platform == "cygwin" :142 if sys.platform == "cygwin" or sys.platform == "os2emx" or sys.platform == "os2knix": 143 143 exe_extension = ".exe" 144 144 … … 284 284 # we use this hack. 285 285 compiler = os.path.basename(sysconfig.get_config_var("CC")) 286 if sys.platform[:6] == "darwin" :286 if sys.platform[:6] == "darwin" or sys.platform[:7] == "os2knix": 287 287 # MacOSX's linker doesn't understand the -R flag at all 288 288 return "-L" + dir -
python/trunk/Lib/os.py
r2 r10 75 75 except ImportError: 76 76 pass 77 if sys.version.find('EMX GCC') == -1: 77 if sys.platform == 'os2knix': 78 import os2knixpath as path 79 elif sys.version.find('EMX GCC') == -1: 78 80 import ntpath as path 79 81 else: -
python/trunk/Lib/popen2.py
r2 r10 135 135 136 136 137 if sys.platform[:3] == "win" or sys.platform == "os2emx" :137 if sys.platform[:3] == "win" or sys.platform == "os2emx" or sys.platform == "os2knix": 138 138 # Some things don't make sense on non-Unix platforms. 139 139 del Popen3, Popen4 -
python/trunk/Lib/site.py
r2 r10 232 232 return os.path.expanduser(os.path.join(*args)) 233 233 234 #if sys.platform in ('os2emx', ' riscos'):234 #if sys.platform in ('os2emx', 'os2knix', 'riscos'): 235 235 # # Don't know what to put here 236 236 # USER_BASE = '' … … 263 263 seen.append(prefix) 264 264 265 if sys.platform in ('os2emx', ' riscos'):265 if sys.platform in ('os2emx', 'os2knix', 'riscos'): 266 266 sitedirs.append(os.path.join(prefix, "Lib", "site-packages")) 267 267 elif os.sep == '/': … … 495 495 known_paths = addusersitepackages(known_paths) 496 496 known_paths = addsitepackages(known_paths) 497 if sys.platform == 'os2emx': 497 if sys.platform == 'os2emx' or sys.platform == 'os2knix': 498 if (sys.path and os.path.basename(sys.path[-1]) == "Modules"): 499 addbuilddir() 498 500 setBEGINLIBPATH() 499 501 setquit() -
python/trunk/Lib/tempfile.py
r2 r10 388 388 # the wrapper to do anything special. We still use it so that 389 389 # file.name is useful (i.e. not "(fdopen)") with NamedTemporaryFile. 390 if _os.name != 'nt' :390 if _os.name != 'nt' and _os.name != 'os2': 391 391 # Cache the unlinker so we don't get spurious errors at 392 392 # shutdown when the module-level "os" is None'd out. Note … … 446 446 return _TemporaryFileWrapper(file, name, delete) 447 447 448 if _os.name != 'posix' or _os.sys.platform == 'cygwin' :448 if _os.name != 'posix' or _os.sys.platform == 'cygwin' or _os.sys.platform == 'os2emx' or _os.sys.platform == 'os2knix': 449 449 # On non-POSIX and Cygwin systems, assume that we cannot unlink a file 450 450 # while it is open. -
python/trunk/Lib/test/regrtest.py
r2 r10 1037 1037 test_signal 1038 1038 """, 1039 'os2knix': 1040 """ 1041 test_al 1042 test_applesingle 1043 test_audioop 1044 test_bsddb185 1045 test_bsddb3 1046 test_cd 1047 test_cl 1048 test_commands 1049 test_dl 1050 test_gl 1051 test_imgfile 1052 test_linuxaudiodev 1053 test_mhlib 1054 test_mmap 1055 test_nis 1056 test_openpty 1057 test_ossaudiodev 1058 test_pty 1059 test_resource 1060 test_sqlite 1061 test_startfile 1062 test_sunaudiodev 1063 """, 1039 1064 'freebsd4': 1040 1065 """ -
python/trunk/Lib/test/test_tempfile.py
r2 r10 260 260 mode = stat.S_IMODE(os.stat(file.name).st_mode) 261 261 expected = 0600 262 if sys.platform in ('win32', 'os2emx', ' mac'):262 if sys.platform in ('win32', 'os2emx', 'os2knix', 'mac'): 263 263 # There's no distinction among 'user', 'group' and 'world'; 264 264 # replicate the 'user' bits. … … 479 479 mode &= 0777 # Mask off sticky bits inherited from /tmp 480 480 expected = 0700 481 if sys.platform in ('win32', 'os2emx', ' mac'):481 if sys.platform in ('win32', 'os2emx', 'os2knix', 'mac'): 482 482 # There's no distinction among 'user', 'group' and 'world'; 483 483 # replicate the 'user' bits. -
python/trunk/Lib/test/test_unicodedata.py
r2 r10 72 72 # but the other test cases will still be run 73 73 import unicodedata 74 self.db = unicodedata75 74 76 75 def tearDown(self): -
python/trunk/Lib/urllib2.py
r2 r10 1275 1275 host = req.get_host() 1276 1276 file = req.get_selector() 1277 1278 # YD hack: add again drive name 1279 if os.name == 'os2' and len(host)>2 and host[1] == ':': 1280 file = host + file 1281 host = "" 1282 1277 1283 localfile = url2pathname(file) 1278 1284 try:
Note:
See TracChangeset
for help on using the changeset viewer.