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
8124feb0
Kaydet (Commit)
8124feb0
authored
May 07, 2010
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
module_repr(): use %U to format the file name
Avoid useless encode/decode of the filename
üst
e3c7381c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
5 deletions
+15
-5
moduleobject.c
Objects/moduleobject.c
+15
-5
No files found.
Objects/moduleobject.c
Dosyayı görüntüle @
8124feb0
...
@@ -191,8 +191,8 @@ PyModule_GetName(PyObject *m)
...
@@ -191,8 +191,8 @@ PyModule_GetName(PyObject *m)
return
_PyUnicode_AsString
(
nameobj
);
return
_PyUnicode_AsString
(
nameobj
);
}
}
const
char
*
static
PyObject
*
PyModule_GetF
ilename
(
PyObject
*
m
)
module_getf
ilename
(
PyObject
*
m
)
{
{
PyObject
*
d
;
PyObject
*
d
;
PyObject
*
fileobj
;
PyObject
*
fileobj
;
...
@@ -208,6 +208,16 @@ PyModule_GetFilename(PyObject *m)
...
@@ -208,6 +208,16 @@ PyModule_GetFilename(PyObject *m)
PyErr_SetString
(
PyExc_SystemError
,
"module filename missing"
);
PyErr_SetString
(
PyExc_SystemError
,
"module filename missing"
);
return
NULL
;
return
NULL
;
}
}
return
fileobj
;
}
const
char
*
PyModule_GetFilename
(
PyObject
*
m
)
{
PyObject
*
fileobj
;
fileobj
=
module_getfilename
(
m
);
if
(
fileobj
==
NULL
)
return
NULL
;
return
_PyUnicode_AsString
(
fileobj
);
return
_PyUnicode_AsString
(
fileobj
);
}
}
...
@@ -327,19 +337,19 @@ static PyObject *
...
@@ -327,19 +337,19 @@ static PyObject *
module_repr
(
PyModuleObject
*
m
)
module_repr
(
PyModuleObject
*
m
)
{
{
const
char
*
name
;
const
char
*
name
;
const
char
*
filename
;
PyObject
*
filename
;
name
=
PyModule_GetName
((
PyObject
*
)
m
);
name
=
PyModule_GetName
((
PyObject
*
)
m
);
if
(
name
==
NULL
)
{
if
(
name
==
NULL
)
{
PyErr_Clear
();
PyErr_Clear
();
name
=
"?"
;
name
=
"?"
;
}
}
filename
=
PyModule_GetF
ilename
((
PyObject
*
)
m
);
filename
=
module_getf
ilename
((
PyObject
*
)
m
);
if
(
filename
==
NULL
)
{
if
(
filename
==
NULL
)
{
PyErr_Clear
();
PyErr_Clear
();
return
PyUnicode_FromFormat
(
"<module '%s' (built-in)>"
,
name
);
return
PyUnicode_FromFormat
(
"<module '%s' (built-in)>"
,
name
);
}
}
return
PyUnicode_FromFormat
(
"<module '%s' from '%
s
'>"
,
name
,
filename
);
return
PyUnicode_FromFormat
(
"<module '%s' from '%
U
'>"
,
name
,
filename
);
}
}
static
int
static
int
...
...
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