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
33d15f7c
Kaydet (Commit)
33d15f7c
authored
Ock 25, 2012
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Port import fixes from 2.7.
üst
dd21f689
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
12 deletions
+12
-12
test_file_loader.py
Lib/importlib/test/source/test_file_loader.py
+1
-1
test_import.py
Lib/test/test_import.py
+1
-1
import.c
Python/import.c
+10
-10
No files found.
Lib/importlib/test/source/test_file_loader.py
Dosyayı görüntüle @
33d15f7c
...
...
@@ -138,7 +138,7 @@ class SimpleTest(unittest.TestCase):
with
open
(
source
,
'w'
)
as
f
:
f
.
write
(
"x = 5"
)
try
:
os
.
utime
(
source
,
(
2
**
33
,
2
**
33
))
os
.
utime
(
source
,
(
2
**
33
-
5
,
2
**
33
-
5
))
except
OverflowError
:
self
.
skipTest
(
"cannot set modification time to large integer"
)
except
OSError
as
e
:
...
...
Lib/test/test_import.py
Dosyayı görüntüle @
33d15f7c
...
...
@@ -321,7 +321,7 @@ class ImportTests(unittest.TestCase):
with
open
(
source
,
'w'
)
as
f
:
pass
try
:
os
.
utime
(
source
,
(
2
**
33
,
2
**
33
))
os
.
utime
(
source
,
(
2
**
33
-
5
,
2
**
33
-
5
))
except
OverflowError
:
self
.
skipTest
(
"cannot set modification time to large integer"
)
except
OSError
as
e
:
...
...
Python/import.c
Dosyayı görüntüle @
33d15f7c
...
...
@@ -1226,9 +1226,9 @@ write_compiled_module(PyCodeObject *co, char *cpathname, struct stat *srcstat)
(
void
)
unlink
(
cpathname
);
return
;
}
/* Now write the true mtime */
/* Now write the true mtime
(as a 32-bit field)
*/
fseek
(
fp
,
4L
,
0
);
assert
(
mtime
<
LONG_MAX
);
assert
(
mtime
<
=
0xFFFFFFFF
);
PyMarshal_WriteLongToFile
((
long
)
mtime
,
fp
,
Py_MARSHAL_VERSION
);
fflush
(
fp
);
fclose
(
fp
);
...
...
@@ -1302,14 +1302,14 @@ load_source_module(char *name, char *pathname, FILE *fp)
pathname
);
return
NULL
;
}
#if SIZEOF_TIME_T > 4
/* Python's .pyc timestamp handling presumes that the timestamp fits
in 4 bytes. Since the code only does an equality comparison,
ordering is not important and we can safely ignore the higher bits
(collisions are extremely unlikely).
*/
st
.
st_mtime
&=
0xFFFFFFFF
;
#endif
if
(
sizeof
st
.
st_mtime
>
4
)
{
/* Python's .pyc timestamp handling presumes that the timestamp fits
in 4 bytes. Since the code only does an equality comparison,
ordering is not important and we can safely ignore the higher bits
(collisions are extremely unlikely).
*/
st
.
st_mtime
&=
0xFFFFFFFF
;
}
cpathname
=
make_compiled_pathname
(
pathname
,
buf
,
(
size_t
)
MAXPATHLEN
+
1
,
!
Py_OptimizeFlag
);
if
(
cpathname
!=
NULL
&&
...
...
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