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
9bdd6133
Kaydet (Commit)
9bdd6133
authored
Nis 24, 2015
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
remove dead *-import checking code (closes #24049)
üst
bd91ee9c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
35 deletions
+0
-35
executionmodel.rst
Doc/reference/executionmodel.rst
+0
-4
symtable.c
Python/symtable.c
+0
-31
No files found.
Doc/reference/executionmodel.rst
Dosyayı görüntüle @
9bdd6133
...
@@ -161,10 +161,6 @@ conjunction with nested scopes that contain free variables.
...
@@ -161,10 +161,6 @@ conjunction with nested scopes that contain free variables.
If a variable is referenced in an enclosing scope, it is illegal to delete the
If a variable is referenced in an enclosing scope, it is illegal to delete the
name. An error will be reported at compile time.
name. An error will be reported at compile time.
If the wild card form of import --- ``import *`` --- is used in a function and
the function contains or is a nested block with free variables, the compiler
will raise a :exc:`SyntaxError`.
.. XXX from * also invalid with relative imports (at least currently)
.. XXX from * also invalid with relative imports (at least currently)
The :func:`eval` and :func:`exec` functions do not have access to the full
The :func:`eval` and :func:`exec` functions do not have access to the full
...
...
Python/symtable.c
Dosyayı görüntüle @
9bdd6133
...
@@ -583,35 +583,6 @@ drop_class_free(PySTEntryObject *ste, PyObject *free)
...
@@ -583,35 +583,6 @@ drop_class_free(PySTEntryObject *ste, PyObject *free)
return
1
;
return
1
;
}
}
/* Check for illegal statements in unoptimized namespaces */
static
int
check_unoptimized
(
const
PySTEntryObject
*
ste
)
{
const
char
*
trailer
;
if
(
ste
->
ste_type
!=
FunctionBlock
||
!
ste
->
ste_unoptimized
||
!
(
ste
->
ste_free
||
ste
->
ste_child_free
))
return
1
;
trailer
=
(
ste
->
ste_child_free
?
"contains a nested function with free variables"
:
"is a nested function"
);
switch
(
ste
->
ste_unoptimized
)
{
case
OPT_TOPLEVEL
:
/* import * at top-level is fine */
return
1
;
case
OPT_IMPORT_STAR
:
PyErr_Format
(
PyExc_SyntaxError
,
"import * is not allowed in function '%U' because it %s"
,
ste
->
ste_name
,
trailer
);
break
;
}
PyErr_SyntaxLocationObject
(
ste
->
ste_table
->
st_filename
,
ste
->
ste_opt_lineno
,
ste
->
ste_opt_col_offset
);
return
0
;
}
/* Enter the final scope information into the ste_symbols dict.
/* Enter the final scope information into the ste_symbols dict.
*
*
* All arguments are dicts. Modifies symbols, others are read-only.
* All arguments are dicts. Modifies symbols, others are read-only.
...
@@ -854,8 +825,6 @@ analyze_block(PySTEntryObject *ste, PyObject *bound, PyObject *free,
...
@@ -854,8 +825,6 @@ analyze_block(PySTEntryObject *ste, PyObject *bound, PyObject *free,
if
(
!
update_symbols
(
ste
->
ste_symbols
,
scopes
,
bound
,
newfree
,
if
(
!
update_symbols
(
ste
->
ste_symbols
,
scopes
,
bound
,
newfree
,
ste
->
ste_type
==
ClassBlock
))
ste
->
ste_type
==
ClassBlock
))
goto
error
;
goto
error
;
if
(
!
check_unoptimized
(
ste
))
goto
error
;
temp
=
PyNumber_InPlaceOr
(
free
,
newfree
);
temp
=
PyNumber_InPlaceOr
(
free
,
newfree
);
if
(
!
temp
)
if
(
!
temp
)
...
...
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