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
fadcd317
Commit
fadcd317
authored
Oct 23, 2011
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Drop unused macros. Use CACHEDIR consistently.
parent
8a0ef78e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
8 deletions
+4
-8
Python/import.c
Python/import.c
+4
-8
No files found.
Python/import.c
View file @
fadcd317
...
...
@@ -108,8 +108,8 @@ typedef unsigned short mode_t;
/* MAGIC must change whenever the bytecode emitted by the compiler may no
longer be understood by older implementations of the eval loop (usually
due to the addition of new opcodes)
TAG
and PYC_TAG_UNICODE must change for each major Python release. The magic
number will take
care of any bytecode changes that occur during development.
TAG
must change for each major Python release. The magic number will take
care of any bytecode changes that occur during development.
*/
#define QUOTE(arg) #arg
#define STRIFY(name) QUOTE(name)
...
...
@@ -118,13 +118,9 @@ typedef unsigned short mode_t;
#define MAGIC (3190 | ((long)'\r'<<16) | ((long)'\n'<<24))
#define TAG "cpython-" MAJOR MINOR;
#define CACHEDIR "__pycache__"
static
const
Py_UCS4
CACHEDIR_UNICODE
[]
=
{
'_'
,
'_'
,
'p'
,
'y'
,
'c'
,
'a'
,
'c'
,
'h'
,
'e'
,
'_'
,
'_'
,
'\0'
};
/* Current magic word and string tag as globals. */
static
long
pyc_magic
=
MAGIC
;
static
const
char
*
pyc_tag
=
TAG
;
static
const
Py_UCS4
PYC_TAG_UNICODE
[]
=
{
'c'
,
'p'
,
'y'
,
't'
,
'h'
,
'o'
,
'n'
,
'-'
,
PY_MAJOR_VERSION
+
48
,
PY_MINOR_VERSION
+
48
,
'\0'
};
#undef QUOTE
#undef STRIFY
#undef MAJOR
...
...
@@ -939,7 +935,7 @@ make_compiled_pathname(PyObject *pathstr, int debug)
{
PyObject
*
result
;
Py_ssize_t
fname
,
ext
,
len
,
i
,
pos
,
taglen
;
Py_ssize_t
pycache_len
=
sizeof
(
"__pycache__/"
)
-
1
;
Py_ssize_t
pycache_len
=
sizeof
(
CACHEDIR
)
-
1
;
int
kind
;
void
*
data
;
...
...
@@ -968,7 +964,7 @@ make_compiled_pathname(PyObject *pathstr, int debug)
PyUnicode_CopyCharacters
(
result
,
0
,
pathstr
,
0
,
fname
);
pos
=
fname
;
for
(
i
=
0
;
i
<
pycache_len
-
1
;
i
++
)
PyUnicode_WRITE
(
kind
,
data
,
pos
++
,
"__pycache__"
[
i
]);
PyUnicode_WRITE
(
kind
,
data
,
pos
++
,
CACHEDIR
[
i
]);
PyUnicode_WRITE
(
kind
,
data
,
pos
++
,
SEP
);
PyUnicode_CopyCharacters
(
result
,
pos
,
pathstr
,
fname
,
ext
-
fname
);
...
...
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