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
98dbba5d
Kaydet (Commit)
98dbba5d
authored
Mar 14, 2011
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #3080: Use repr() to format the module name on error
üst
ccbf475d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
10 deletions
+10
-10
test_pydoc.py
Lib/test/test_pydoc.py
+1
-1
test_loader.py
Lib/unittest/test/test_loader.py
+2
-2
import.c
Python/import.c
+7
-7
No files found.
Lib/test/test_pydoc.py
Dosyayı görüntüle @
98dbba5d
...
...
@@ -190,7 +190,7 @@ war</tt></dd></dl>
missing_pattern
=
"no Python documentation found for '
%
s'"
# output pattern for module with bad imports
badimport_pattern
=
"problem in
%
s - ImportError: No module named
%
s
"
badimport_pattern
=
"problem in
%
s - ImportError: No module named
%
r
"
def
run_pydoc
(
module_name
,
*
args
):
"""
...
...
Lib/unittest/test/test_loader.py
Dosyayı görüntüle @
98dbba5d
...
...
@@ -239,7 +239,7 @@ class Test_TestLoader(unittest.TestCase):
try
:
loader
.
loadTestsFromName
(
'sdasfasfasdf'
)
except
ImportError
as
e
:
self
.
assertEqual
(
str
(
e
),
"No module named
sdasfasfasdf
"
)
self
.
assertEqual
(
str
(
e
),
"No module named
'sdasfasfasdf'
"
)
else
:
self
.
fail
(
"TestLoader.loadTestsFromName failed to raise ImportError"
)
...
...
@@ -619,7 +619,7 @@ class Test_TestLoader(unittest.TestCase):
try
:
loader
.
loadTestsFromNames
([
'sdasfasfasdf'
])
except
ImportError
as
e
:
self
.
assertEqual
(
str
(
e
),
"No module named
sdasfasfasdf
"
)
self
.
assertEqual
(
str
(
e
),
"No module named
'sdasfasfasdf'
"
)
else
:
self
.
fail
(
"TestLoader.loadTestsFromNames failed to raise ImportError"
)
...
...
Python/import.c
Dosyayı görüntüle @
98dbba5d
...
...
@@ -1431,7 +1431,7 @@ load_source_module(PyObject *name, PyObject *pathname, FILE *fp)
goto
error
;
if
(
Py_VerboseFlag
)
PySys_FormatStderr
(
"import %U # from %R
\n
"
,
name
,
pathname
);
name
,
pathname
);
if
(
cpathname
!=
NULL
)
{
PyObject
*
ro
=
PySys_GetObject
(
"dont_write_bytecode"
);
if
(
ro
==
NULL
||
!
PyObject_IsTrue
(
ro
))
...
...
@@ -1517,8 +1517,8 @@ load_package(PyObject *name, PyObject *pathname)
if
(
m
==
NULL
)
return
NULL
;
if
(
Py_VerboseFlag
)
PySys_FormatStderr
(
"import %U # directory %
U
\n
"
,
name
,
pathname
);
PySys_FormatStderr
(
"import %U # directory %
R
\n
"
,
name
,
pathname
);
file
=
get_sourcefile
(
pathname
);
if
(
file
==
NULL
)
return
NULL
;
...
...
@@ -1875,7 +1875,7 @@ find_module_path_list(PyObject *fullname, PyObject *name,
Py_DECREF
(
prefix
);
}
PyErr_Format
(
PyExc_ImportError
,
"No module named %
U
"
,
name
);
"No module named %
R
"
,
name
);
return
NULL
;
}
...
...
@@ -2366,7 +2366,7 @@ load_module(PyObject *name, FILE *fp, PyObject *pathname, int type, PyObject *lo
default:
PyErr_Format
(
PyExc_ImportError
,
"Don't know how to import %
U
(type code %d)"
,
"Don't know how to import %
R
(type code %d)"
,
name
,
type
);
m
=
NULL
;
...
...
@@ -3251,7 +3251,7 @@ PyImport_ReloadModule(PyObject *m)
return
NULL
;
if
(
m
!=
PyDict_GetItem
(
modules
,
nameobj
))
{
PyErr_Format
(
PyExc_ImportError
,
"reload(): module %
U
not in sys.modules"
,
"reload(): module %
R
not in sys.modules"
,
nameobj
);
Py_DECREF
(
nameobj
);
return
NULL
;
...
...
@@ -3286,7 +3286,7 @@ PyImport_ReloadModule(PyObject *m)
parent
=
PyDict_GetItem
(
modules
,
parentname
);
if
(
parent
==
NULL
)
{
PyErr_Format
(
PyExc_ImportError
,
"reload(): parent %
U
not in sys.modules"
,
"reload(): parent %
R
not in sys.modules"
,
parentname
);
Py_DECREF
(
parentname
);
goto
error
;
...
...
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