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
cea681be
Kaydet (Commit)
cea681be
authored
Kas 07, 2007
tarafından
Christian Heimes
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Backported fix for bug #1392 from py3k branch r58903.
üst
90b858e1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
1 deletion
+19
-1
import.c
Python/import.c
+19
-1
No files found.
Python/import.c
Dosyayı görüntüle @
cea681be
...
...
@@ -2978,6 +2978,7 @@ static int
NullImporter_init
(
NullImporter
*
self
,
PyObject
*
args
,
PyObject
*
kwds
)
{
char
*
path
;
Py_ssize_t
pathlen
;
if
(
!
_PyArg_NoKeywords
(
"NullImporter()"
,
kwds
))
return
-
1
;
...
...
@@ -2986,7 +2987,8 @@ NullImporter_init(NullImporter *self, PyObject *args, PyObject *kwds)
&
path
))
return
-
1
;
if
(
strlen
(
path
)
==
0
)
{
pathlen
=
strlen
(
path
);
if
(
pathlen
==
0
)
{
PyErr_SetString
(
PyExc_ImportError
,
"empty pathname"
);
return
-
1
;
}
else
{
...
...
@@ -2994,7 +2996,23 @@ NullImporter_init(NullImporter *self, PyObject *args, PyObject *kwds)
struct
stat
statbuf
;
int
rv
;
#ifdef MS_WINDOWS
/* MS Windows' stat chokes on paths like C:\\path\\. Try to
* recover *one* time by stripping of a trailing slash or
* back slash. http://bugs.python.org/issue1293
*/
rv
=
stat
(
path
,
&
statbuf
);
if
(
rv
!=
0
&&
pathlen
<=
MAXPATHLEN
&&
(
path
[
pathlen
-
1
]
==
'/'
||
path
[
pathlen
-
1
]
==
'\\'
))
{
char
mangled
[
MAXPATHLEN
+
1
];
strcpy
(
mangled
,
path
);
mangled
[
pathlen
-
1
]
=
'\0'
;
rv
=
stat
(
mangled
,
&
statbuf
);
}
#else
rv
=
stat
(
path
,
&
statbuf
);
#endif
if
(
rv
==
0
)
{
/* it exists */
if
(
S_ISDIR
(
statbuf
.
st_mode
))
{
...
...
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