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
4870b92b
Commit
4870b92b
authored
9 years ago
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
os.environ updates should propagate
Just another HAVE_foo define we were missing.
parent
a3196dd0
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
20 additions
and
6 deletions
+20
-6
from_cpython/Include/pyconfig.h
from_cpython/Include/pyconfig.h
+1
-0
from_cpython/Modules/posixmodule.c
from_cpython/Modules/posixmodule.c
+1
-1
src/runtime/list.cpp
src/runtime/list.cpp
+2
-0
src/runtime/objmodel.cpp
src/runtime/objmodel.cpp
+4
-0
test/tests/list.py
test/tests/list.py
+2
-0
test/tests/os_test.py
test/tests/os_test.py
+10
-5
No files found.
from_cpython/Include/pyconfig.h
View file @
4870b92b
...
...
@@ -124,6 +124,7 @@
#define HAVE_UNISTD_H 1
#define HAVE_UTIME_H 1
#define HAVE_WCHAR_H 1
#define HAVE_PUTENV 1
// Added this for some Pyston modifications:
#define MAX_PYSTRING_SIZE (PY_SSIZE_T_MAX/2 - (1<<20))
...
...
This diff is collapsed.
Click to expand it.
from_cpython/Modules/posixmodule.c
View file @
4870b92b
...
...
@@ -9451,7 +9451,7 @@ INITFUNC(void)
#ifdef HAVE_PUTENV
if
(
posix_putenv_garbage
==
NULL
)
posix_putenv_garbage
=
Py
Dict_New
(
);
posix_putenv_garbage
=
Py
GC_AddRoot
(
PyDict_New
()
);
#endif
if
(
!
initialized
)
{
...
...
This diff is collapsed.
Click to expand it.
src/runtime/list.cpp
View file @
4870b92b
...
...
@@ -1103,6 +1103,8 @@ void setupList() {
"index"
,
new
BoxedFunction
(
boxRTFunction
((
void
*
)
listIndex
,
BOXED_INT
,
4
,
2
,
false
,
false
),
{
NULL
,
NULL
}));
list_cls
->
giveAttr
(
"remove"
,
new
BoxedFunction
(
boxRTFunction
((
void
*
)
listRemove
,
NONE
,
2
)));
list_cls
->
giveAttr
(
"reverse"
,
new
BoxedFunction
(
boxRTFunction
((
void
*
)
listReverse
,
NONE
,
1
)));
list_cls
->
giveAttr
(
"__hash__"
,
None
);
list_cls
->
freeze
();
CLFunction
*
hasnext
=
boxRTFunction
((
void
*
)
listiterHasnextUnboxed
,
BOOL
,
1
);
...
...
This diff is collapsed.
Click to expand it.
src/runtime/objmodel.cpp
View file @
4870b92b
...
...
@@ -2113,6 +2113,10 @@ extern "C" BoxedInt* hash(Box* obj) {
return
static_cast
<
BoxedInt
*>
(
boxInt
((
i64
)
obj
));
}
if
(
hash
==
None
)
{
raiseExcHelper
(
TypeError
,
"unhashable type: '%s'"
,
obj
->
cls
->
tp_name
);
}
Box
*
rtn
=
runtimeCall0
(
hash
,
ArgPassSpec
(
0
));
if
(
rtn
->
cls
!=
int_cls
)
{
raiseExcHelper
(
TypeError
,
"an integer is required"
);
...
...
This diff is collapsed.
Click to expand it.
test/tests/list.py
View file @
4870b92b
...
...
@@ -195,3 +195,5 @@ l.sort(cmp=mycmp, key=str)
print types_seen
print l
"""
print
repr
(
list
.
__hash__
)
This diff is collapsed.
Click to expand it.
test/tests/os_test.py
View file @
4870b92b
...
...
@@ -23,8 +23,13 @@ print e.strerror
print
e
.
filename
print
OSError
(
1
,
2
).
filename
# This part needs sys.exc_info() and the three-arg raise statement
# try:
# os.execvp("aoeuaoeu", ['aoeuaoeu'])
# except OSError, e:
# print e
try
:
os
.
execvp
(
"aoeuaoeu"
,
[
'aoeuaoeu'
])
except
OSError
,
e
:
print
e
# Changes to os.environ should show up in subprocesses:
import
subprocess
env
=
os
.
environ
env
[
"PYTHONPATH"
]
=
"."
subprocess
.
check_call
(
"echo PYTHONPATH is $PYTHONPATH"
,
shell
=
1
)
This diff is collapsed.
Click to expand it.
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