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
42b145d0
Kaydet (Commit)
42b145d0
authored
Tem 08, 2009
tarafından
Tarek Ziadé
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Sets the compiler attribute to keep the old behavior for third-party packages.
üst
5fd3af24
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
4 deletions
+29
-4
build_ext.py
Lib/distutils/command/build_ext.py
+19
-3
test_build_ext.py
Lib/distutils/tests/test_build_ext.py
+10
-1
No files found.
Lib/distutils/command/build_ext.py
Dosyayı görüntüle @
42b145d0
...
...
@@ -134,13 +134,17 @@ class build_ext (Command):
def
_set_compiler
(
self
,
compiler
):
if
not
isinstance
(
compiler
,
str
)
and
compiler
is
not
None
:
# we don't want to allow that anymore in the future
warn
(
"'compiler' specif
y
the compiler type in build_ext. "
warn
(
"'compiler' specif
ies
the compiler type in build_ext. "
"If you want to get the compiler object itself, "
"use 'compiler_obj'"
,
PendingDeprecationWarning
)
self
.
_compiler
=
compiler
def
_get_compiler
(
self
):
if
not
isinstance
(
self
.
_compiler
,
str
)
and
self
.
_compiler
is
not
None
:
# we don't want to allow that anymore in the future
warn
(
"'compiler' specifies the compiler type in build_ext. "
"If you want to get the compiler object itself, "
"use 'compiler_obj'"
,
PendingDeprecationWarning
)
return
self
.
_compiler
compiler
=
property
(
_get_compiler
,
_set_compiler
)
...
...
@@ -343,10 +347,22 @@ class build_ext (Command):
# Setup the CCompiler object that we'll use to do all the
# compiling and linking
self
.
compiler_obj
=
new_compiler
(
compiler
=
self
.
compiler
,
# used to prevent the usage of an existing compiler for the
# compiler option when calling new_compiler()
# this will be removed in 3.3 and 2.8
if
not
isinstance
(
self
.
_compiler
,
str
):
self
.
_compiler
=
None
self
.
compiler_obj
=
new_compiler
(
compiler
=
self
.
_compiler
,
verbose
=
self
.
verbose
,
dry_run
=
self
.
dry_run
,
force
=
self
.
force
)
# used to keep the compiler object reachable with
# "self.compiler". this will be removed in 3.3 and 2.8
self
.
_compiler
=
self
.
compiler_obj
customize_compiler
(
self
.
compiler_obj
)
# If we are cross-compiling, init the compiler now (if we are not
# cross-compiling, init would not hurt, but people may rely on
...
...
Lib/distutils/tests/test_build_ext.py
Dosyayı görüntüle @
42b145d0
...
...
@@ -402,12 +402,21 @@ class BuildExtTestCase(support.TempdirManager,
dist
=
Distribution
()
cmd
=
build_ext
(
dist
)
class
MyCompiler
(
object
):
def
do_something
(
self
):
pass
with
check_warnings
()
as
w
:
warnings
.
simplefilter
(
"always"
)
cmd
.
compiler
=
object
()
cmd
.
compiler
=
MyCompiler
()
self
.
assertEquals
(
len
(
w
.
warnings
),
1
)
cmd
.
compile
=
'unix'
self
.
assertEquals
(
len
(
w
.
warnings
),
1
)
cmd
.
compiler
=
MyCompiler
()
cmd
.
compiler
.
do_something
()
# two more warnings genereated by the get
# and the set
self
.
assertEquals
(
len
(
w
.
warnings
),
3
)
def
test_suite
():
src
=
_get_source_filename
()
...
...
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