Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
25d2bae1
Kaydet (Commit)
25d2bae1
authored
Haz 11, 2009
tarafından
Tarek Ziadé
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #5201: now distutils.sysconfig.parse_makefile() understands '53264' in Makefiles
üst
d81333c5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
7 deletions
+51
-7
sysconfig.py
Lib/distutils/sysconfig.py
+14
-7
test_sysconfig.py
Lib/distutils/tests/test_sysconfig.py
+33
-0
NEWS
Misc/NEWS
+4
-0
No files found.
Lib/distutils/sysconfig.py
Dosyayı görüntüle @
25d2bae1
...
...
@@ -285,18 +285,25 @@ def parse_makefile(fn, g=None):
while
1
:
line
=
fp
.
readline
()
if
line
is
None
:
# eof
if
line
is
None
:
# eof
break
m
=
_variable_rx
.
match
(
line
)
if
m
:
n
,
v
=
m
.
group
(
1
,
2
)
v
=
string
.
strip
(
v
)
if
"$"
in
v
:
v
=
v
.
strip
()
# `$$' is a literal `$' in make
tmpv
=
v
.
replace
(
'$$'
,
''
)
if
"$"
in
tmpv
:
notdone
[
n
]
=
v
else
:
try
:
v
=
int
(
v
)
except
ValueError
:
pass
done
[
n
]
=
v
try
:
v
=
int
(
v
)
except
ValueError
:
# insert literal `$'
done
[
n
]
=
v
.
replace
(
'$$'
,
'$'
)
else
:
done
[
n
]
=
v
# do variable interpolation here
while
notdone
:
...
...
@@ -324,7 +331,7 @@ def parse_makefile(fn, g=None):
else
:
try
:
value
=
int
(
value
)
except
ValueError
:
done
[
name
]
=
string
.
strip
(
value
)
done
[
name
]
=
value
.
strip
(
)
else
:
done
[
name
]
=
value
del
notdone
[
name
]
...
...
Lib/distutils/tests/test_sysconfig.py
Dosyayı görüntüle @
25d2bae1
"""Tests for distutils.sysconfig."""
import
os
import
test
import
unittest
from
distutils
import
sysconfig
...
...
@@ -9,6 +10,14 @@ from test.test_support import TESTFN
class
SysconfigTestCase
(
support
.
EnvironGuard
,
unittest
.
TestCase
):
def
setUp
(
self
):
super
(
SysconfigTestCase
,
self
)
.
setUp
()
self
.
makefile
=
None
def
tearDown
(
self
):
if
self
.
makefile
is
not
None
:
os
.
unlink
(
self
.
makefile
)
super
(
SysconfigTestCase
,
self
)
.
tearDown
()
def
test_get_config_h_filename
(
self
):
config_h
=
sysconfig
.
get_config_h_filename
()
...
...
@@ -56,8 +65,32 @@ class SysconfigTestCase(support.EnvironGuard,
sysconfig
.
customize_compiler
(
comp
)
self
.
assertEquals
(
comp
.
exes
[
'archiver'
],
'my_ar -arflags'
)
def
test_parse_makefile_base
(
self
):
self
.
makefile
=
test
.
test_support
.
TESTFN
fd
=
open
(
self
.
makefile
,
'w'
)
fd
.
write
(
r"CONFIG_ARGS= '--arg1=optarg1' 'ENV=LIB'"
'
\n
'
)
fd
.
write
(
'VAR=$OTHER
\n
OTHER=foo'
)
fd
.
close
()
d
=
sysconfig
.
parse_makefile
(
self
.
makefile
)
self
.
assertEquals
(
d
,
{
'CONFIG_ARGS'
:
"'--arg1=optarg1' 'ENV=LIB'"
,
'OTHER'
:
'foo'
})
def
test_parse_makefile_literal_dollar
(
self
):
self
.
makefile
=
test
.
test_support
.
TESTFN
fd
=
open
(
self
.
makefile
,
'w'
)
fd
.
write
(
r"CONFIG_ARGS= '--arg1=optarg1' 'ENV=\$$LIB'"
'
\n
'
)
fd
.
write
(
'VAR=$OTHER
\n
OTHER=foo'
)
fd
.
close
()
d
=
sysconfig
.
parse_makefile
(
self
.
makefile
)
self
.
assertEquals
(
d
,
{
'CONFIG_ARGS'
:
r"'--arg1=optarg1' 'ENV=\$LIB'"
,
'OTHER'
:
'foo'
})
def
test_suite
():
suite
=
unittest
.
TestSuite
()
suite
.
addTest
(
unittest
.
makeSuite
(
SysconfigTestCase
))
return
suite
if
__name__
==
'__main__'
:
test
.
test_support
.
run_unittest
(
test_suite
())
Misc/NEWS
Dosyayı görüntüle @
25d2bae1
...
...
@@ -317,6 +317,10 @@ Core and Builtins
Library
-------
- Issue #5201: distutils.sysconfig.parse_makefile() now understands `$$`
in Makefiles. This prevents compile errors when using syntax like:
`LDFLAGS='-rpath=\$$LIB:/some/other/path'`. Patch by Floris Bruynooghe.
- Issue #5767: Removed sgmlop support from xmlrpclib.
- Issue #6131: test_modulefinder leaked when run after test_distutils.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment