Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9020bce

Browse files
committed
- _filename_to_abs() didn't cater for .. components in the pathname. Fixed.
- compile() didn't return a (empty) list of objects. Fixed. - the various _fix_xxx_args() methods weren't called (are they new or did I overlook them?). Fixed.
1 parent 97df7b6 commit 9020bce

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

Lib/distutils/mwerkscompiler.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,13 @@ def compile (self,
6262
debug=0,
6363
extra_preargs=None,
6464
extra_postargs=None):
65+
(output_dir, macros, include_dirs) = \
66+
self._fix_compile_args (output_dir, macros, include_dirs)
6567
self.__sources = sources
6668
self.__macros = macros
6769
self.__include_dirs = include_dirs
6870
# Don't need extra_preargs and extra_postargs for CW
71+
return []
6972

7073
def link (self,
7174
target_desc,
@@ -80,6 +83,11 @@ def link (self,
8083
extra_preargs=None,
8184
extra_postargs=None,
8285
build_temp=None):
86+
# First fixup.
87+
(objects, output_dir) = self._fix_object_args (objects, output_dir)
88+
(libraries, library_dirs, runtime_library_dirs) = \
89+
self._fix_lib_args (libraries, library_dirs, runtime_library_dirs)
90+
8391
# First examine a couple of options for things that aren't implemented yet
8492
if not target_desc in (self.SHARED_LIBRARY, self.SHARED_OBJECT):
8593
raise DistutilsPlatformError, 'Can only make SHARED_LIBRARY or SHARED_OBJECT targets on the Mac'
@@ -200,6 +208,11 @@ def _filename_to_abs(self, filename):
200208
if not os.path.isabs(filename):
201209
curdir = os.getcwd()
202210
filename = os.path.join(curdir, filename)
203-
return filename
211+
# Finally remove .. components
212+
components = string.split(filename, ':')
213+
for i in range(1, len(components)):
214+
if components[i] == '..':
215+
components[i] = ''
216+
return string.join(components, ':')
204217

205218

0 commit comments

Comments
 (0)