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
143bdfce
Kaydet (Commit)
143bdfce
authored
May 25, 2006
tarafından
Thomas Wouters
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Update graminit.c for the fix for #1488915, Multiple dots in relative import
statement raise SyntaxError, and add testcase.
üst
cf8229ea
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
21 deletions
+25
-21
test_importhooks.py
Lib/test/test_importhooks.py
+10
-1
graminit.c
Python/graminit.c
+15
-20
No files found.
Lib/test/test_importhooks.py
Dosyayı görüntüle @
143bdfce
...
@@ -14,6 +14,7 @@ def get_file():
...
@@ -14,6 +14,7 @@ def get_file():
absimp
=
"import sub
\n
"
absimp
=
"import sub
\n
"
relimp
=
"from . import sub
\n
"
relimp
=
"from . import sub
\n
"
deeprelimp
=
"from .... import sub
\n
"
futimp
=
"from __future__ import absolute_import
\n
"
futimp
=
"from __future__ import absolute_import
\n
"
reload_src
=
test_src
+
"""
\
reload_src
=
test_src
+
"""
\
...
@@ -26,6 +27,7 @@ reload_co = compile(reload_src, "<???>", "exec")
...
@@ -26,6 +27,7 @@ reload_co = compile(reload_src, "<???>", "exec")
test2_oldabs_co
=
compile
(
absimp
+
test_src
,
"<???>"
,
"exec"
)
test2_oldabs_co
=
compile
(
absimp
+
test_src
,
"<???>"
,
"exec"
)
test2_newabs_co
=
compile
(
futimp
+
absimp
+
test_src
,
"<???>"
,
"exec"
)
test2_newabs_co
=
compile
(
futimp
+
absimp
+
test_src
,
"<???>"
,
"exec"
)
test2_newrel_co
=
compile
(
relimp
+
test_src
,
"<???>"
,
"exec"
)
test2_newrel_co
=
compile
(
relimp
+
test_src
,
"<???>"
,
"exec"
)
test2_deeprel_co
=
compile
(
deeprelimp
+
test_src
,
"<???>"
,
"exec"
)
test2_futrel_co
=
compile
(
futimp
+
relimp
+
test_src
,
"<???>"
,
"exec"
)
test2_futrel_co
=
compile
(
futimp
+
relimp
+
test_src
,
"<???>"
,
"exec"
)
test_path
=
"!!!_test_!!!"
test_path
=
"!!!_test_!!!"
...
@@ -46,10 +48,11 @@ class TestImporter:
...
@@ -46,10 +48,11 @@ class TestImporter:
"hooktestmodule"
:
(
False
,
test_co
),
"hooktestmodule"
:
(
False
,
test_co
),
"hooktestpackage"
:
(
True
,
test_co
),
"hooktestpackage"
:
(
True
,
test_co
),
"hooktestpackage.sub"
:
(
True
,
test_co
),
"hooktestpackage.sub"
:
(
True
,
test_co
),
"hooktestpackage.sub.subber"
:
(
Fals
e
,
test_co
),
"hooktestpackage.sub.subber"
:
(
Tru
e
,
test_co
),
"hooktestpackage.oldabs"
:
(
False
,
test2_oldabs_co
),
"hooktestpackage.oldabs"
:
(
False
,
test2_oldabs_co
),
"hooktestpackage.newabs"
:
(
False
,
test2_newabs_co
),
"hooktestpackage.newabs"
:
(
False
,
test2_newabs_co
),
"hooktestpackage.newrel"
:
(
False
,
test2_newrel_co
),
"hooktestpackage.newrel"
:
(
False
,
test2_newrel_co
),
"hooktestpackage.sub.subber.subest"
:
(
True
,
test2_deeprel_co
),
"hooktestpackage.futrel"
:
(
False
,
test2_futrel_co
),
"hooktestpackage.futrel"
:
(
False
,
test2_futrel_co
),
"sub"
:
(
False
,
test_co
),
"sub"
:
(
False
,
test_co
),
"reloadmodule"
:
(
False
,
test_co
),
"reloadmodule"
:
(
False
,
test_co
),
...
@@ -203,6 +206,12 @@ class ImportHooksTestCase(ImportHooksBaseTestCase):
...
@@ -203,6 +206,12 @@ class ImportHooksTestCase(ImportHooksBaseTestCase):
self
.
assertEqual
(
hooktestpackage
.
newrel
.
sub
,
self
.
assertEqual
(
hooktestpackage
.
newrel
.
sub
,
hooktestpackage
.
sub
)
hooktestpackage
.
sub
)
import
hooktestpackage.sub.subber.subest
as
subest
self
.
assertEqual
(
subest
.
get_name
(),
"hooktestpackage.sub.subber.subest"
)
self
.
assertEqual
(
subest
.
sub
,
hooktestpackage
.
sub
)
import
hooktestpackage.futrel
import
hooktestpackage.futrel
self
.
assertEqual
(
hooktestpackage
.
futrel
.
get_name
(),
self
.
assertEqual
(
hooktestpackage
.
futrel
.
get_name
(),
"hooktestpackage.futrel"
)
"hooktestpackage.futrel"
)
...
...
Python/graminit.c
Dosyayı görüntüle @
143bdfce
...
@@ -517,41 +517,36 @@ static arc arcs_26_1[2] = {
...
@@ -517,41 +517,36 @@ static arc arcs_26_1[2] = {
{
12
,
3
},
{
12
,
3
},
};
};
static
arc
arcs_26_2
[
3
]
=
{
static
arc
arcs_26_2
[
3
]
=
{
{
75
,
4
},
{
75
,
2
},
{
12
,
3
},
{
12
,
3
},
{
72
,
5
},
{
72
,
4
},
};
};
static
arc
arcs_26_3
[
1
]
=
{
static
arc
arcs_26_3
[
1
]
=
{
{
72
,
5
},
{
72
,
4
},
};
};
static
arc
arcs_26_4
[
2
]
=
{
static
arc
arcs_26_4
[
3
]
=
{
{
75
,
4
},
{
28
,
5
},
{
12
,
3
},
{
13
,
6
},
{
76
,
5
},
};
};
static
arc
arcs_26_5
[
3
]
=
{
static
arc
arcs_26_5
[
1
]
=
{
{
28
,
6
},
{
0
,
5
},
{
13
,
7
},
{
76
,
6
},
};
};
static
arc
arcs_26_6
[
1
]
=
{
static
arc
arcs_26_6
[
1
]
=
{
{
0
,
6
},
{
76
,
7
},
};
};
static
arc
arcs_26_7
[
1
]
=
{
static
arc
arcs_26_7
[
1
]
=
{
{
76
,
8
},
{
15
,
5
},
};
static
arc
arcs_26_8
[
1
]
=
{
{
15
,
6
},
};
};
static
state
states_26
[
9
]
=
{
static
state
states_26
[
8
]
=
{
{
1
,
arcs_26_0
},
{
1
,
arcs_26_0
},
{
2
,
arcs_26_1
},
{
2
,
arcs_26_1
},
{
3
,
arcs_26_2
},
{
3
,
arcs_26_2
},
{
1
,
arcs_26_3
},
{
1
,
arcs_26_3
},
{
2
,
arcs_26_4
},
{
3
,
arcs_26_4
},
{
3
,
arcs_26_5
},
{
1
,
arcs_26_5
},
{
1
,
arcs_26_6
},
{
1
,
arcs_26_6
},
{
1
,
arcs_26_7
},
{
1
,
arcs_26_7
},
{
1
,
arcs_26_8
},
};
};
static
arc
arcs_27_0
[
1
]
=
{
static
arc
arcs_27_0
[
1
]
=
{
{
19
,
1
},
{
19
,
1
},
...
@@ -1839,7 +1834,7 @@ static dfa dfas[84] = {
...
@@ -1839,7 +1834,7 @@ static dfa dfas[84] = {
"
\000\000\000\000\000\000\000\000\000\005\000\000\000\000\000\000\000\000\000\000\000
"
},
"
\000\000\000\000\000\000\000\000\000\005\000\000\000\000\000\000\000\000\000\000\000
"
},
{
281
,
"import_name"
,
0
,
3
,
states_25
,
{
281
,
"import_name"
,
0
,
3
,
states_25
,
"
\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000
"
},
"
\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000
"
},
{
282
,
"import_from"
,
0
,
9
,
states_26
,
{
282
,
"import_from"
,
0
,
8
,
states_26
,
"
\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000
"
},
"
\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000
"
},
{
283
,
"import_as_name"
,
0
,
4
,
states_27
,
{
283
,
"import_as_name"
,
0
,
4
,
states_27
,
"
\000\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000
"
},
"
\000\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000
"
},
...
...
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