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
c01ffdf6
Kaydet (Commit)
c01ffdf6
authored
Mar 26, 2011
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
revert unintended changes
üst
39530f8c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
18 deletions
+1
-18
refactor.py
Lib/lib2to3/refactor.py
+1
-1
test_refactor.py
Lib/lib2to3/tests/test_refactor.py
+0
-17
No files found.
Lib/lib2to3/refactor.py
Dosyayı görüntüle @
c01ffdf6
...
@@ -500,7 +500,7 @@ class RefactoringTool(object):
...
@@ -500,7 +500,7 @@ class RefactoringTool(object):
node
=
new
node
=
new
def
processed_file
(
self
,
new_text
,
filename
,
old_text
=
None
,
write
=
False
,
def
processed_file
(
self
,
new_text
,
filename
,
old_text
=
None
,
write
=
False
,
encoding
=
None
,
newlines
=
None
):
encoding
=
None
):
"""
"""
Called when a file has been refactored, and there are changes.
Called when a file has been refactored, and there are changes.
"""
"""
...
...
Lib/lib2to3/tests/test_refactor.py
Dosyayı görüntüle @
c01ffdf6
...
@@ -231,23 +231,6 @@ from __future__ import print_function"""
...
@@ -231,23 +231,6 @@ from __future__ import print_function"""
os
.
path
.
join
(
"a_dir"
,
"stuff.py"
)]
os
.
path
.
join
(
"a_dir"
,
"stuff.py"
)]
check
(
tree
,
tree
)
check
(
tree
,
tree
)
def
test_preserve_file_newlines
(
self
):
rt
=
self
.
rt
(
fixers
=
_2TO3_FIXERS
)
for
nl
in
(
"
\r\n
"
,
"
\n
"
):
data
=
"print y
%
s
%
syes
%
sok
%
s"
%
((
nl
,)
*
4
)
handle
,
tmp
=
tempfile
.
mkstemp
()
os
.
close
(
handle
)
try
:
with
open
(
tmp
,
"w"
)
as
fp
:
fp
.
write
(
data
)
rt
.
refactor_file
(
tmp
)
with
open
(
tmp
,
"r"
)
as
fp
:
contents
=
fp
.
read
()
finally
:
os
.
unlink
(
tmp
)
for
line
in
contents
.
splitlines
(
True
):
self
.
assertTrue
(
line
.
endswith
(
nl
))
def
test_file_encoding
(
self
):
def
test_file_encoding
(
self
):
fn
=
os
.
path
.
join
(
TEST_DATA_DIR
,
"different_encoding.py"
)
fn
=
os
.
path
.
join
(
TEST_DATA_DIR
,
"different_encoding.py"
)
self
.
check_file_refactoring
(
fn
)
self
.
check_file_refactoring
(
fn
)
...
...
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