Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
3ddee714
Commit
3ddee714
authored
Dec 16, 1991
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New magic word; and check it.
parent
75f8968e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
Python/import.c
Python/import.c
+8
-3
No files found.
Python/import.c
View file @
3ddee714
...
...
@@ -37,6 +37,10 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "compile.h"
#include "ceval.h"
/* Magic word to reject pre-0.9.4 .pyc files */
#define MAGIC 0x949494L
/* Define pathname separator used in file names */
#ifdef macintosh
...
...
@@ -160,9 +164,10 @@ get_module(m, name, m_ret)
fpc
=
fopen
(
namebuf
,
"rb"
);
if
(
fpc
!=
NULL
)
{
long
pyc_mtime
;
(
void
)
rd_long
(
fpc
);
/* Reserved for magic word */
long
magic
;
magic
=
rd_long
(
fpc
);
pyc_mtime
=
rd_long
(
fpc
);
if
(
pyc_mtime
!=
0
&&
pyc_mtime
!=
-
1
&&
pyc_mtime
==
mtime
)
{
if
(
magic
==
MAGIC
&&
pyc_mtime
==
mtime
&&
mtime
!=
0
&&
mtime
!=
-
1
)
{
v
=
rd_object
(
fpc
);
if
(
v
==
NULL
||
err_occurred
()
||
!
is_codeobject
(
v
))
{
err_clear
();
...
...
@@ -202,7 +207,7 @@ get_module(m, name, m_ret)
namebuf
[
namelen
+
1
]
=
'\0'
;
fpc
=
fopen
(
namebuf
,
"wb"
);
if
(
fpc
!=
NULL
)
{
wr_long
(
0L
,
fpc
);
/* Reserved for magic word */
wr_long
(
MAGIC
,
fpc
);
/* First write a 0 for mtime */
wr_long
(
0L
,
fpc
);
wr_object
((
object
*
)
co
,
fpc
);
...
...
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