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
33b6450d
Kaydet (Commit)
33b6450d
authored
Eki 15, 2008
tarafından
Martin v. Löwis
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #4072: Restore build_py_2to3. Add a distutils demo for
build_py_2to3.
üst
aa306692
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
53 additions
and
12 deletions
+53
-12
README
Demo/distutils/test2to3/README
+4
-0
setup.py
Demo/distutils/test2to3/setup.py
+18
-0
__init__.py
Demo/distutils/test2to3/test2to3/__init__.py
+1
-0
hello.py
Demo/distutils/test2to3/test2to3/hello.py
+5
-0
build_py.py
Lib/distutils/command/build_py.py
+18
-12
NEWS
Misc/NEWS
+7
-0
No files found.
Demo/distutils/test2to3/README
0 → 100644
Dosyayı görüntüle @
33b6450d
This project demonstrates how a distutils package
can support Python 2.x and Python 3.x from a single
source, using lib2to3.
\ No newline at end of file
Demo/distutils/test2to3/setup.py
0 → 100644
Dosyayı görüntüle @
33b6450d
# -*- coding: iso-8859-1 -*-
from
distutils.core
import
setup
try
:
from
distutils.command.build_py
import
build_py_2to3
as
build_py
except
ImportError
:
from
distutils.command.build_py
import
build_py
setup
(
name
=
"test2to3"
,
version
=
"1.0"
,
description
=
"2to3 distutils test package"
,
author
=
"Martin v. Lwis"
,
author_email
=
"python-dev@python.org"
,
license
=
"PSF license"
,
packages
=
[
"test2to3"
],
cmdclass
=
{
'build_py'
:
build_py
}
)
Demo/distutils/test2to3/test2to3/__init__.py
0 → 100644
Dosyayı görüntüle @
33b6450d
# empty
Demo/distutils/test2to3/test2to3/hello.py
0 → 100644
Dosyayı görüntüle @
33b6450d
def
hello
():
try
:
print
"Hello, world"
except
IOError
,
e
:
print
e
.
errno
Lib/distutils/command/build_py.py
Dosyayı görüntüle @
33b6450d
...
...
@@ -384,6 +384,18 @@ class build_py (Command):
byte_compile
(
files
,
optimize
=
self
.
optimize
,
force
=
self
.
force
,
prefix
=
prefix
,
dry_run
=
self
.
dry_run
)
from
lib2to3.refactor
import
RefactoringTool
,
get_fixers_from_package
class
DistutilsRefactoringTool
(
RefactoringTool
):
def
log_error
(
self
,
msg
,
*
args
,
**
kw
):
# XXX ignores kw
log
.
error
(
msg
,
*
args
)
def
log_message
(
self
,
msg
,
*
args
):
log
.
info
(
msg
,
*
args
)
def
log_debug
(
self
,
msg
,
*
args
):
log
.
debug
(
msg
,
*
args
)
class
build_py_2to3
(
build_py
):
def
run
(
self
):
self
.
updated_files
=
[]
...
...
@@ -396,18 +408,12 @@ class build_py_2to3(build_py):
self
.
build_package_data
()
# 2to3
from
lib2to3.refactor
import
RefactoringTool
class
Options
:
pass
o
=
Options
()
o
.
doctests_only
=
False
o
.
fix
=
[]
o
.
list_fixes
=
[]
o
.
print_function
=
False
o
.
verbose
=
False
o
.
write
=
True
r
=
RefactoringTool
(
o
)
r
.
refactor_args
(
self
.
updated_files
)
fixers
=
get_fixers_from_package
(
'lib2to3.fixes'
)
options
=
dict
(
fix
=
[],
list_fixes
=
[],
print_function
=
False
,
verbose
=
False
,
write
=
True
)
r
=
DistutilsRefactoringTool
(
fixers
,
options
)
r
.
refactor
(
self
.
updated_files
,
write
=
True
)
# Remaining base class code
self
.
byte_compile
(
self
.
get_outputs
(
include_bytecode
=
0
))
...
...
Misc/NEWS
Dosyayı görüntüle @
33b6450d
...
...
@@ -31,6 +31,8 @@ Core and Builtins
Library
-------
- Issue #4072: Restore build_py_2to3.
- Issue #4014: Don't claim that Python has an Alpha release status, in addition
to claiming it is Mature.
...
...
@@ -63,6 +65,11 @@ Build
- Issue #4018: Disable "for me" installations on Vista.
Tools/Demos
-----------
- Issue #4072: Add a distutils demo for build_py_2to3.
What's New in Python 3.0 release candidate 1
============================================
...
...
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