Commit 3294712f authored by Kevin Modzelewski's avatar Kevin Modzelewski

Merge commit '56ec2' into refcounting

parents 7f8cbdab 56ec26a7
# expected: fail
import imp
import unittest
from test import test_support
......
......@@ -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",
......
......@@ -1389,7 +1389,7 @@ Box* longRTrueDiv(BoxedLong* v1, Box* _v2) {
}
AUTO_DECREF(v2);
if (mpz_sgn(v2->n) == 0) {
if (mpz_sgn(v1->n) == 0) {
raiseExcHelper(ZeroDivisionError, "division by zero");
}
......
......@@ -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]
......
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()
......@@ -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))
......
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment