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
b528fcf9
Commit
b528fcf9
authored
Oct 25, 2011
by
Antoine Pitrou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix test_imp failure under Windows
parent
08a95cab
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
Python/import.c
Python/import.c
+9
-2
No files found.
Python/import.c
View file @
b528fcf9
...
...
@@ -938,12 +938,19 @@ make_compiled_pathname(PyObject *pathstr, int debug)
Py_ssize_t
pycache_len
=
sizeof
(
CACHEDIR
)
-
1
;
int
kind
;
void
*
data
;
Py_UCS4
lastsep
;
/* Compute the output string size. */
len
=
PyUnicode_GET_LENGTH
(
pathstr
);
/* If there is no separator, this returns -1, so
lastsep
will be 0. */
fname
will be 0. */
fname
=
rightmost_sep_obj
(
pathstr
,
0
,
len
)
+
1
;
/* Windows: re-use the last separator character (/ or \\) when
appending the __pycache__ path. */
if
(
fname
>
0
)
lastsep
=
PyUnicode_READ_CHAR
(
pathstr
,
fname
-
1
);
else
lastsep
=
SEP
;
ext
=
fname
-
1
;
for
(
i
=
fname
;
i
<
len
;
i
++
)
if
(
PyUnicode_READ_CHAR
(
pathstr
,
i
)
==
'.'
)
...
...
@@ -965,7 +972,7 @@ make_compiled_pathname(PyObject *pathstr, int debug)
pos
=
fname
;
for
(
i
=
0
;
i
<
pycache_len
;
i
++
)
PyUnicode_WRITE
(
kind
,
data
,
pos
++
,
CACHEDIR
[
i
]);
PyUnicode_WRITE
(
kind
,
data
,
pos
++
,
SEP
);
PyUnicode_WRITE
(
kind
,
data
,
pos
++
,
lastsep
);
PyUnicode_CopyCharacters
(
result
,
pos
,
pathstr
,
fname
,
ext
-
fname
);
pos
+=
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