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
2c6722be
Commit
2c6722be
authored
Mar 26, 2015
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some misc features for importing test.test_support
parent
5a0a0ba4
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
1531 additions
and
1 deletion
+1531
-1
from_cpython/Lib/platform.py
from_cpython/Lib/platform.py
+15
-0
from_cpython/Lib/test/__init__.py
from_cpython/Lib/test/__init__.py
+1
-0
from_cpython/Lib/test/test_support.py
from_cpython/Lib/test/test_support.py
+1507
-0
src/runtime/builtin_modules/sys.cpp
src/runtime/builtin_modules/sys.cpp
+1
-0
src/runtime/objmodel.cpp
src/runtime/objmodel.cpp
+2
-1
test/tests/platform_test.py
test/tests/platform_test.py
+4
-0
test/tests/sys_test.py
test/tests/sys_test.py
+1
-0
No files found.
from_cpython/Lib/platform.py
View file @
2c6722be
...
...
@@ -1384,6 +1384,10 @@ _pypy_sys_version_parser = re.compile(
'
\
(#?([^,]+),
\
s*([
\
w ]+),
\
s*([
\
w :]+)
\
)
\
s*
'
'
\
[PyPy [^
\
]]+
\
]?
'
)
_pyston_sys_version_parser = re.compile(
r'([
\
w.+]+)
\
s*'
'
\
[Pys
t
on ([^
\
]]+)
\
]?')
_sys_version_cache = {}
def _sys_version(sys_version=None):
...
...
@@ -1454,6 +1458,17 @@ def _sys_version(sys_version=None):
version, buildno, builddate, buildtime = match.groups()
compiler = ""
elif "Pyston" in sys_version:
# Pyston
name = "Pyston"
match = _pyston_sys_version_parser.match(sys_version)
if match is None:
raise ValueError("failed to parse Pyston sys.version: %s" %
repr(sys_version))
version, buildno = match.groups()
builddate = ""
compiler = ""
else:
# CPython
match = _sys_version_parser.match(sys_version)
...
...
from_cpython/Lib/test/__init__.py
0 → 100644
View file @
2c6722be
# Dummy file to make this directory a package.
from_cpython/Lib/test/test_support.py
0 → 100644
View file @
2c6722be
This diff is collapsed.
Click to expand it.
src/runtime/builtin_modules/sys.cpp
View file @
2c6722be
...
...
@@ -297,6 +297,7 @@ void setupSys() {
boxInt
(
PYTHON_VERSION_MICRO
),
boxStrConstant
(
"beta"
),
boxInt
(
0
)
}));
sys_module
->
giveAttr
(
"maxint"
,
boxInt
(
PYSTON_INT_MAX
));
sys_module
->
giveAttr
(
"maxsize"
,
boxInt
(
PY_SSIZE_T_MAX
));
sys_flags_cls
=
new
BoxedHeapClass
(
object_cls
,
BoxedSysFlags
::
gcHandler
,
0
,
0
,
sizeof
(
BoxedSysFlags
),
false
,
new
BoxedString
(
"flags"
));
...
...
src/runtime/objmodel.cpp
View file @
2c6722be
...
...
@@ -1987,7 +1987,8 @@ extern "C" bool nonzero(Box* obj) {
if
(
func
==
NULL
)
{
ASSERT
(
isUserDefined
(
obj
->
cls
)
||
obj
->
cls
==
classobj_cls
||
obj
->
cls
==
type_cls
||
isSubclass
(
obj
->
cls
,
Exception
)
||
obj
->
cls
==
file_cls
||
obj
->
cls
==
traceback_cls
||
obj
->
cls
==
instancemethod_cls
||
obj
->
cls
==
module_cls
||
obj
->
cls
==
capifunc_cls
,
||
obj
->
cls
==
instancemethod_cls
||
obj
->
cls
==
module_cls
||
obj
->
cls
==
capifunc_cls
||
obj
->
cls
==
builtin_function_or_method_cls
,
"%s.__nonzero__"
,
getTypeName
(
obj
));
// TODO
// TODO should rewrite these?
...
...
test/tests/platform_test.py
0 → 100644
View file @
2c6722be
import
platform
print
type
(
platform
.
python_implementation
())
# print platform._sys_version()
test/tests/sys_test.py
View file @
2c6722be
...
...
@@ -7,3 +7,4 @@ print sys.copyright[-200:]
print
sys
.
byteorder
print
sys
.
getdefaultencoding
()
print
sys
.
getfilesystemencoding
()
print
type
(
sys
.
maxsize
)
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