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
3294712f
Commit
3294712f
authored
Feb 28, 2016
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Plain Diff
Merge commit '56ec2' into refcounting
parents
7f8cbdab
56ec26a7
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
33 additions
and
6 deletions
+33
-6
from_cpython/Lib/test/test_imp.py
from_cpython/Lib/test/test_imp.py
+0
-1
src/runtime/builtin_modules/builtins.cpp
src/runtime/builtin_modules/builtins.cpp
+4
-3
src/runtime/long.cpp
src/runtime/long.cpp
+1
-1
test/CPYTHON_TEST_NOTES.md
test/CPYTHON_TEST_NOTES.md
+0
-1
test/extra/unidecode_test.py
test/extra/unidecode_test.py
+26
-0
test/tests/builtins.py
test/tests/builtins.py
+1
-0
test/tests/long.py
test/tests/long.py
+1
-0
No files found.
from_cpython/Lib/test/test_imp.py
View file @
3294712f
# expected: fail
import
imp
import
unittest
from
test
import
test_support
...
...
src/runtime/builtin_modules/builtins.cpp
View file @
3294712f
...
...
@@ -2017,9 +2017,10 @@ void setupBuiltins() {
enumerate_cls
=
BoxedClass
::
create
(
type_cls
,
object_cls
,
0
,
0
,
sizeof
(
BoxedEnumerate
),
false
,
"enumerate"
,
false
,
BoxedEnumerate
::
dealloc
,
NULL
,
true
,
BoxedEnumerate
::
traverse
,
NOCLEAR
);
enumerate_cls
->
giveAttr
(
"__new__"
,
new
BoxedFunction
(
FunctionMetadata
::
create
((
void
*
)
BoxedEnumerate
::
new_
,
UNKNOWN
,
3
,
false
,
false
),
{
autoDecref
(
boxInt
(
0
))
}));
enumerate_cls
->
giveAttr
(
"__new__"
,
new
BoxedFunction
(
FunctionMetadata
::
create
((
void
*
)
BoxedEnumerate
::
new_
,
UNKNOWN
,
3
,
ParamNames
({
""
,
"sequence"
,
"start"
},
""
,
""
)),
{
autoDecref
(
boxInt
(
0
))
}));
enumerate_cls
->
giveAttr
(
"__iter__"
,
new
BoxedFunction
(
FunctionMetadata
::
create
((
void
*
)
BoxedEnumerate
::
iter
,
typeFromClass
(
enumerate_cls
),
1
)));
enumerate_cls
->
giveAttr
(
"next"
,
...
...
src/runtime/long.cpp
View file @
3294712f
...
...
@@ -1389,7 +1389,7 @@ Box* longRTrueDiv(BoxedLong* v1, Box* _v2) {
}
AUTO_DECREF
(
v2
);
if
(
mpz_sgn
(
v
2
->
n
)
==
0
)
{
if
(
mpz_sgn
(
v
1
->
n
)
==
0
)
{
raiseExcHelper
(
ZeroDivisionError
,
"division by zero"
);
}
...
...
test/CPYTHON_TEST_NOTES.md
View file @
3294712f
...
...
@@ -111,7 +111,6 @@ test_imaplib [unknown]
test_imgfile [unknown]
test_importhooks [unknown]
test_import [unknown]
test_imp [unknown]
test_inspect [unknown]
test_io memory/gc issue?
test_iterlen [unknown]
...
...
test/extra/unidecode_test.py
0 → 100644
View file @
3294712f
import
os
,
sys
,
subprocess
,
shutil
sys
.
path
.
append
(
os
.
path
.
dirname
(
__file__
)
+
"/../lib"
)
from
test_helper
import
create_virtenv
,
run_test
ENV_NAME
=
"unidecode_test_env_"
+
os
.
path
.
basename
(
sys
.
executable
)
SRC_DIR
=
os
.
path
.
abspath
(
os
.
path
.
join
(
ENV_NAME
,
"src"
))
PYTHON_EXE
=
os
.
path
.
abspath
(
os
.
path
.
join
(
ENV_NAME
,
"bin"
,
"python"
))
def
install_and_test_unidecode
():
shutil
.
rmtree
(
SRC_DIR
,
ignore_errors
=
True
)
os
.
makedirs
(
SRC_DIR
)
url
=
"https://pypi.python.org/packages/source/U/Unidecode/Unidecode-0.04.16.tar.gz"
subprocess
.
check_call
([
"wget"
,
url
],
cwd
=
SRC_DIR
)
subprocess
.
check_call
([
"tar"
,
"-zxf"
,
"Unidecode-0.04.16.tar.gz"
],
cwd
=
SRC_DIR
)
UNIDECODE_DIR
=
os
.
path
.
abspath
(
os
.
path
.
join
(
SRC_DIR
,
"Unidecode-0.04.16"
))
subprocess
.
check_call
([
PYTHON_EXE
,
"setup.py"
,
"build"
],
cwd
=
UNIDECODE_DIR
)
subprocess
.
check_call
([
PYTHON_EXE
,
"setup.py"
,
"install"
],
cwd
=
UNIDECODE_DIR
)
expected
=
[{
'ran'
:
8
}]
run_test
([
PYTHON_EXE
,
"setup.py"
,
"test"
],
cwd
=
UNIDECODE_DIR
,
expected
=
expected
)
create_virtenv
(
ENV_NAME
,
None
,
force_create
=
True
)
install_and_test_unidecode
()
test/tests/builtins.py
View file @
3294712f
...
...
@@ -36,6 +36,7 @@ print zip([1, 2, 3, 0], ["one", "two", "three"], ["uno", "dos", "tres", "quatro"
print
filter
(
lambda
x
:
x
%
2
,
xrange
(
20
))
print
type
(
enumerate
([]))
print
list
(
enumerate
(
xrange
(
5
,
10
)))
print
list
(
enumerate
(
start
=-
42
,
sequence
=
xrange
(
5
,
10
)))
# If the first argument is None, filter calls checks for truthiness (ie is equivalent to passing 'bool')
print
filter
(
None
,
xrange
(
-
5
,
5
))
...
...
test/tests/long.py
View file @
3294712f
...
...
@@ -70,6 +70,7 @@ print pow(-5, 3, 7L)
print
pow
(
-
5
,
3
,
-
7L
)
print
(
11L
).
__pow__
(
32
,
50L
)
print
(
11L
).
__index__
()
print
(
11L
).
__rtruediv__
(
0
)
print
long
(
"100"
,
16
)
print
long
(
"100"
,
10
)
...
...
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