Skip to content

Commit d17833d

Browse files
committed
Closes #16135: Removal of OS/2 support (distutils)
1 parent 9407d50 commit d17833d

12 files changed

+7
-425
lines changed

Lib/distutils/ccompiler.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ def _setup_compile(self, outdir, macros, incdirs, sources, depends,
351351
return macros, objects, extra, pp_opts, build
352352

353353
def _get_cc_args(self, pp_opts, debug, before):
354-
# works for unixccompiler, emxccompiler, cygwinccompiler
354+
# works for unixccompiler, cygwinccompiler
355355
cc_args = pp_opts + ['-c']
356356
if debug:
357357
cc_args[:0] = ['-g']
@@ -926,7 +926,6 @@ def mkpath (self, name, mode=0o777):
926926
# on a cygwin built python we can use gcc like an ordinary UNIXish
927927
# compiler
928928
('cygwin.*', 'unix'),
929-
('os2emx', 'emx'),
930929

931930
# OS name mappings
932931
('posix', 'unix'),
@@ -968,8 +967,6 @@ def get_default_compiler(osname=None, platform=None):
968967
"Mingw32 port of GNU C Compiler for Win32"),
969968
'bcpp': ('bcppcompiler', 'BCPPCompiler',
970969
"Borland C++ Compiler"),
971-
'emx': ('emxccompiler', 'EMXCCompiler',
972-
"EMX port of GNU C Compiler for OS/2"),
973970
}
974971

975972
def show_compilers():

Lib/distutils/command/bdist.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ class bdist(Command):
5252
# This won't do in reality: will need to distinguish RPM-ish Linux,
5353
# Debian-ish Linux, Solaris, FreeBSD, ..., Windows, Mac OS.
5454
default_format = {'posix': 'gztar',
55-
'nt': 'zip',
56-
'os2': 'zip'}
55+
'nt': 'zip'}
5756

5857
# Establish the preferred order (for the --help-formats option).
5958
format_commands = ['rpm', 'gztar', 'bztar', 'ztar', 'tar',

Lib/distutils/command/bdist_dumb.py

+1-7
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ class bdist_dumb(Command):
3838
boolean_options = ['keep-temp', 'skip-build', 'relative']
3939

4040
default_format = { 'posix': 'gztar',
41-
'nt': 'zip',
42-
'os2': 'zip' }
41+
'nt': 'zip' }
4342

4443
def initialize_options(self):
4544
self.bdist_dir = None
@@ -85,11 +84,6 @@ def run(self):
8584
archive_basename = "%s.%s" % (self.distribution.get_fullname(),
8685
self.plat_name)
8786

88-
# OS/2 objects to any ":" characters in a filename (such as when
89-
# a timestamp is used in a version) so change them to hyphens.
90-
if os.name == "os2":
91-
archive_basename = archive_basename.replace(":", "-")
92-
9387
pseudoinstall_root = os.path.join(self.dist_dir, archive_basename)
9488
if not self.relative:
9589
archive_root = self.bdist_dir

Lib/distutils/command/build_ext.py

+1-25
Original file line numberDiff line numberDiff line change
@@ -223,11 +223,6 @@ def finalize_options(self):
223223
self.library_dirs.append(os.path.join(sys.exec_prefix,
224224
'PC', 'VC6'))
225225

226-
# OS/2 (EMX) doesn't support Debug vs Release builds, but has the
227-
# import libraries in its "Config" subdirectory
228-
if os.name == 'os2':
229-
self.library_dirs.append(os.path.join(sys.exec_prefix, 'Config'))
230-
231226
# for extensions under Cygwin and AtheOS Python's library directory must be
232227
# appended to library_dirs
233228
if sys.platform[:6] == 'cygwin' or sys.platform[:6] == 'atheos':
@@ -613,9 +608,6 @@ def find_swig(self):
613608
return fn
614609
else:
615610
return "swig.exe"
616-
elif os.name == "os2":
617-
# assume swig available in the PATH.
618-
return "swig.exe"
619611
else:
620612
raise DistutilsPlatformError(
621613
"I don't know how to find (much less run) SWIG "
@@ -666,9 +658,6 @@ def get_ext_filename(self, ext_name):
666658
"""
667659
from distutils.sysconfig import get_config_var
668660
ext_path = ext_name.split('.')
669-
# OS/2 has an 8 character module (extension) limit :-(
670-
if os.name == "os2":
671-
ext_path[len(ext_path) - 1] = ext_path[len(ext_path) - 1][:8]
672661
# extensions in debug_mode are named 'module_d.pyd' under windows
673662
so_ext = get_config_var('SO')
674663
if os.name == 'nt' and self.debug:
@@ -689,7 +678,7 @@ def get_export_symbols(self, ext):
689678
def get_libraries(self, ext):
690679
"""Return the list of libraries to link against when building a
691680
shared extension. On most platforms, this is just 'ext.libraries';
692-
on Windows and OS/2, we add the Python library (eg. python20.dll).
681+
on Windows, we add the Python library (eg. python20.dll).
693682
"""
694683
# The python library is always needed on Windows. For MSVC, this
695684
# is redundant, since the library is mentioned in a pragma in
@@ -709,19 +698,6 @@ def get_libraries(self, ext):
709698
return ext.libraries + [pythonlib]
710699
else:
711700
return ext.libraries
712-
elif sys.platform == "os2emx":
713-
# EMX/GCC requires the python library explicitly, and I
714-
# believe VACPP does as well (though not confirmed) - AIM Apr01
715-
template = "python%d%d"
716-
# debug versions of the main DLL aren't supported, at least
717-
# not at this time - AIM Apr01
718-
#if self.debug:
719-
# template = template + '_d'
720-
pythonlib = (template %
721-
(sys.hexversion >> 24, (sys.hexversion >> 16) & 0xff))
722-
# don't extend ext.libraries, it may be shared with other
723-
# extensions, it is a reference to the original list
724-
return ext.libraries + [pythonlib]
725701
elif sys.platform[:6] == "cygwin":
726702
template = "python%d.%d"
727703
pythonlib = (template %

Lib/distutils/command/install.py

-15
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,6 @@
5858
'data' : '$base',
5959
},
6060
'nt': WINDOWS_SCHEME,
61-
'os2': {
62-
'purelib': '$base/Lib/site-packages',
63-
'platlib': '$base/Lib/site-packages',
64-
'headers': '$base/Include/$dist_name',
65-
'scripts': '$base/Scripts',
66-
'data' : '$base',
67-
},
6861
}
6962

7063
# user site schemes
@@ -86,14 +79,6 @@
8679
'data' : '$userbase',
8780
}
8881

89-
INSTALL_SCHEMES['os2_home'] = {
90-
'purelib': '$usersite',
91-
'platlib': '$usersite',
92-
'headers': '$userbase/include/python$py_version_short/$dist_name',
93-
'scripts': '$userbase/bin',
94-
'data' : '$userbase',
95-
}
96-
9782
# The keys to an installation scheme; if any new types of files are to be
9883
# installed, be sure to add an entry to every installation scheme above,
9984
# and to SCHEME_KEYS here.

0 commit comments

Comments
 (0)