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
52c1f515
Kaydet (Commit)
52c1f515
authored
Eki 25, 1993
tarafından
Sjoerd Mullender
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
import.c: When something is wrong with the .pyc, properly open the .py
file. object.c: Write allocation statistics to stderr.
üst
89b3325d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
34 deletions
+40
-34
object.c
Objects/object.c
+9
-8
import.c
Python/import.c
+31
-26
No files found.
Objects/object.c
Dosyayı görüntüle @
52c1f515
...
@@ -45,14 +45,15 @@ dump_counts()
...
@@ -45,14 +45,15 @@ dump_counts()
typeobject
*
tp
;
typeobject
*
tp
;
for
(
tp
=
type_list
;
tp
;
tp
=
tp
->
tp_next
)
for
(
tp
=
type_list
;
tp
;
tp
=
tp
->
tp_next
)
printf
(
"%s alloc'd: %d, freed: %d, max in use: %d
\n
"
,
fprintf
(
stderr
,
"%s alloc'd: %d, freed: %d, max in use: %d
\n
"
,
tp
->
tp_name
,
tp
->
tp_alloc
,
tp
->
tp_free
,
tp
->
tp_name
,
tp
->
tp_alloc
,
tp
->
tp_free
,
tp
->
tp_maxalloc
);
tp
->
tp_maxalloc
);
printf
(
"fast tuple allocs: %d, empty: %d
\n
"
,
fast_tuple_allocs
,
fprintf
(
stderr
,
"fast tuple allocs: %d, empty: %d
\n
"
,
tuple_zero_allocs
);
fast_tuple_allocs
,
tuple_zero_allocs
);
printf
(
"fast int allocs: pos: %d, neg: %d
\n
"
,
quick_int_allocs
,
fprintf
(
stderr
,
"fast int allocs: pos: %d, neg: %d
\n
"
,
quick_neg_int_allocs
);
quick_int_allocs
,
quick_neg_int_allocs
);
printf
(
"null strings: %d, 1-strings: %d
\n
"
,
null_strings
,
one_strings
);
fprintf
(
stderr
,
"null strings: %d, 1-strings: %d
\n
"
,
null_strings
,
one_strings
);
}
}
void
void
...
...
Python/import.c
Dosyayı görüntüle @
52c1f515
...
@@ -228,7 +228,6 @@ get_module(m, name, m_ret)
...
@@ -228,7 +228,6 @@ get_module(m, name, m_ret)
pyc_mtime
=
rd_long
(
fpc
);
pyc_mtime
=
rd_long
(
fpc
);
if
(
mtime
!=
-
1
&&
mtime
>
pyc_mtime
)
{
if
(
mtime
!=
-
1
&&
mtime
>
pyc_mtime
)
{
fclose
(
fpc
);
fclose
(
fpc
);
fp
=
fopen
(
namebuf
,
"rb"
);
goto
read_py
;
goto
read_py
;
}
}
if
(
magic
==
MAGIC
)
{
if
(
magic
==
MAGIC
)
{
...
@@ -247,40 +246,46 @@ get_module(m, name, m_ret)
...
@@ -247,40 +246,46 @@ get_module(m, name, m_ret)
fprintf
(
stderr
,
fprintf
(
stderr
,
"import %s # precompiled from
\"
%s
\"\n
"
,
"import %s # precompiled from
\"
%s
\"\n
"
,
name
,
namebuf
);
name
,
namebuf
);
else
else
{
fprintf
(
stderr
,
fprintf
(
stderr
,
"# invalid precompiled file
\"
%s
\"\n
"
,
"# invalid precompiled file
\"
%s
\"\n
"
,
namebuf
);
namebuf
);
}
goto
read_py
;
}
}
else
if
((
fp
=
find_module
(
name
,
PY_SUFFIX
,
"r"
,
namebuf
,
&
mtime
))
!=
NULL
)
{
read_py
:
namelen
=
strlen
(
namebuf
);
if
(
co
==
NULL
)
{
if
(
verbose
)
fprintf
(
stderr
,
"import %s # from
\"
%s
\"\n
"
,
name
,
namebuf
);
err
=
parse_file
(
fp
,
namebuf
,
file_input
,
&
n
);
}
else
err
=
E_DONE
;
fclose
(
fp
);
if
(
err
!=
E_DONE
)
{
err_input
(
err
);
return
NULL
;
}
}
}
}
else
{
else
{
if
(
m
==
NULL
)
{
read_py
:
sprintf
(
namebuf
,
"no module named %.200s"
,
name
);
if
((
fp
=
find_module
(
name
,
PY_SUFFIX
,
"r"
,
err_setstr
(
ImportError
,
namebuf
);
namebuf
,
&
mtime
))
!=
NULL
)
{
namelen
=
strlen
(
namebuf
);
if
(
co
==
NULL
)
{
if
(
verbose
)
fprintf
(
stderr
,
"import %s # from
\"
%s
\"\n
"
,
name
,
namebuf
);
err
=
parse_file
(
fp
,
namebuf
,
file_input
,
&
n
);
}
else
err
=
E_DONE
;
fclose
(
fp
);
if
(
err
!=
E_DONE
)
{
err_input
(
err
);
return
NULL
;
}
}
}
else
{
else
{
sprintf
(
namebuf
,
"no source for module %.200s"
,
name
);
if
(
m
==
NULL
)
{
err_setstr
(
ImportError
,
namebuf
);
sprintf
(
namebuf
,
"no module named %.200s"
,
name
);
err_setstr
(
ImportError
,
namebuf
);
}
else
{
sprintf
(
namebuf
,
"no source for module %.200s"
,
name
);
err_setstr
(
ImportError
,
namebuf
);
}
return
NULL
;
}
}
return
NULL
;
}
}
if
(
m
==
NULL
)
{
if
(
m
==
NULL
)
{
m
=
add_module
(
name
);
m
=
add_module
(
name
);
...
...
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