Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
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
Boxiang Sun
Pyston
Commits
d7a9fd9a
Commit
d7a9fd9a
authored
Apr 17, 2015
by
Marius Wachtler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set correct site-package directory, fix 'str * -1', add sys.dont_write_bytecode
parent
6c3ef5aa
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
2 deletions
+14
-2
from_cpython/Lib/distutils/sysconfig.py
from_cpython/Lib/distutils/sysconfig.py
+7
-2
src/runtime/builtin_modules/sys.cpp
src/runtime/builtin_modules/sys.cpp
+3
-0
src/runtime/str.cpp
src/runtime/str.cpp
+2
-0
test/tests/str_functions.py
test/tests/str_functions.py
+2
-0
No files found.
from_cpython/Lib/distutils/sysconfig.py
View file @
d7a9fd9a
...
@@ -126,12 +126,17 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
...
@@ -126,12 +126,17 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
prefix
=
plat_specific
and
EXEC_PREFIX
or
PREFIX
prefix
=
plat_specific
and
EXEC_PREFIX
or
PREFIX
if
os
.
name
==
"posix"
:
if
os
.
name
==
"posix"
:
# Pyston change
# libpython = os.path.join(prefix,
# "lib", "python" + get_python_version())
libpython
=
os
.
path
.
join
(
prefix
,
libpython
=
os
.
path
.
join
(
prefix
,
"
lib"
,
"python"
+
get_python_version
()
)
"
from_cpython"
,
"Lib"
)
if
standard_lib
:
if
standard_lib
:
return
libpython
return
libpython
else
:
else
:
return
os
.
path
.
join
(
libpython
,
"site-packages"
)
# Pyston change
# return os.path.join(libpython, "site-packages")
return
os
.
path
.
join
(
prefix
,
"site-packages"
)
elif
os
.
name
==
"nt"
:
elif
os
.
name
==
"nt"
:
if
standard_lib
:
if
standard_lib
:
...
...
src/runtime/builtin_modules/sys.cpp
View file @
d7a9fd9a
...
@@ -311,6 +311,9 @@ void setupSys() {
...
@@ -311,6 +311,9 @@ void setupSys() {
sys_module
->
giveAttr
(
"path_hooks"
,
new
BoxedList
());
sys_module
->
giveAttr
(
"path_hooks"
,
new
BoxedList
());
sys_module
->
giveAttr
(
"path_importer_cache"
,
new
BoxedDict
());
sys_module
->
giveAttr
(
"path_importer_cache"
,
new
BoxedDict
());
// As we don't support compile() etc yet force 'dont_write_bytecode' to true.
sys_module
->
giveAttr
(
"dont_write_bytecode"
,
True
);
sys_module
->
giveAttr
(
"prefix"
,
boxStrConstant
(
Py_GetPrefix
()));
sys_module
->
giveAttr
(
"prefix"
,
boxStrConstant
(
Py_GetPrefix
()));
sys_module
->
giveAttr
(
"exec_prefix"
,
boxStrConstant
(
Py_GetExecPrefix
()));
sys_module
->
giveAttr
(
"exec_prefix"
,
boxStrConstant
(
Py_GetExecPrefix
()));
...
...
src/runtime/str.cpp
View file @
d7a9fd9a
...
@@ -1106,6 +1106,8 @@ extern "C" Box* strMul(BoxedString* lhs, Box* rhs) {
...
@@ -1106,6 +1106,8 @@ extern "C" Box* strMul(BoxedString* lhs, Box* rhs) {
n
=
static_cast
<
BoxedInt
*>
(
rhs
)
->
n
;
n
=
static_cast
<
BoxedInt
*>
(
rhs
)
->
n
;
else
else
return
NotImplemented
;
return
NotImplemented
;
if
(
n
<=
0
)
return
boxString
(
""
);
// TODO: use createUninitializedString and getWriteableStringContents
// TODO: use createUninitializedString and getWriteableStringContents
int
sz
=
lhs
->
size
();
int
sz
=
lhs
->
size
();
...
...
test/tests/str_functions.py
View file @
d7a9fd9a
...
@@ -166,3 +166,5 @@ print "1".zfill(3), "+1".zfill(3), "-1".zfill(3), "0".zfill(3)
...
@@ -166,3 +166,5 @@ print "1".zfill(3), "+1".zfill(3), "-1".zfill(3), "0".zfill(3)
it
=
iter
(
"hello world"
)
it
=
iter
(
"hello world"
)
print
list
(
it
)
print
list
(
it
)
print
"'{0}' '{1}'"
.
format
(
"Hello "
*
3
,
"Hello "
*
-
3
)
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