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
f066c1ba
Kaydet (Commit)
f066c1ba
authored
Agu 04, 2007
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Make test_tokenize really pass -- don't add extra output.
üst
cfbbf48e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
test_tokenize.py
Lib/test/test_tokenize.py
+2
-2
No files found.
Lib/test/test_tokenize.py
Dosyayı görüntüle @
f066c1ba
...
@@ -98,7 +98,7 @@ _PRINT_WORKING_MSG_INTERVAL = 5 * 60
...
@@ -98,7 +98,7 @@ _PRINT_WORKING_MSG_INTERVAL = 5 * 60
# and tokenized again from the latter. The test fails if the second
# and tokenized again from the latter. The test fails if the second
# tokenization doesn't match the first.
# tokenization doesn't match the first.
def
test_roundtrip
(
f
):
def
test_roundtrip
(
f
):
## print
'Testing:', f
## print
('Testing:', f)
# Get the encoding first
# Get the encoding first
fobj
=
open
(
f
,
encoding
=
"latin-1"
)
fobj
=
open
(
f
,
encoding
=
"latin-1"
)
first2lines
=
fobj
.
readline
()
+
fobj
.
readline
()
first2lines
=
fobj
.
readline
()
+
fobj
.
readline
()
...
@@ -106,7 +106,7 @@ def test_roundtrip(f):
...
@@ -106,7 +106,7 @@ def test_roundtrip(f):
m
=
re
.
search
(
r"coding:\s*(\S+)"
,
first2lines
)
m
=
re
.
search
(
r"coding:\s*(\S+)"
,
first2lines
)
if
m
:
if
m
:
encoding
=
m
.
group
(
1
)
encoding
=
m
.
group
(
1
)
print
(
" coding:"
,
encoding
)
##
print(" coding:", encoding)
else
:
else
:
encoding
=
"utf-8"
encoding
=
"utf-8"
fobj
=
open
(
f
,
encoding
=
encoding
)
fobj
=
open
(
f
,
encoding
=
encoding
)
...
...
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