# HG changeset patch # User Paul Boddie # Date 1488903226 -3600 # Node ID 932a6b2491990c7e80352c95c478a22a54b836ee # Parent 8cae5848b19164c298543350a2ac12867563a929 Fixed argument number tests for empty parameter lists. Fixed various exception instantiations. diff -r 8cae5848b191 -r 932a6b249199 lib/__builtins__/buffer.py --- a/lib/__builtins__/buffer.py Mon Mar 06 22:29:36 2017 +0100 +++ b/lib/__builtins__/buffer.py Tue Mar 07 17:13:46 2017 +0100 @@ -3,7 +3,7 @@ """ Buffer object. -Copyright (C) 2015, 2016 Paul Boddie +Copyright (C) 2015, 2016, 2017 Paul Boddie This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -34,7 +34,7 @@ elif isinstance(size, int): n = size else: - raise TypeError(size) + raise ValueError(size) self.__data__ = list_init(n) diff -r 8cae5848b191 -r 932a6b249199 lib/__builtins__/tuple.py --- a/lib/__builtins__/tuple.py Mon Mar 06 22:29:36 2017 +0100 +++ b/lib/__builtins__/tuple.py Tue Mar 07 17:13:46 2017 +0100 @@ -3,7 +3,7 @@ """ Tuple objects. -Copyright (C) 2015, 2016 Paul Boddie +Copyright (C) 2015, 2016, 2017 Paul Boddie This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -103,6 +103,6 @@ "Set at the normalised (positive) 'index' the given 'value'." - raise TypeError(self) + raise TypeError # vim: tabstop=4 expandtab shiftwidth=4 diff -r 8cae5848b191 -r 932a6b249199 translator.py --- a/translator.py Mon Mar 06 22:29:36 2017 +0100 +++ b/translator.py Tue Mar 07 17:13:46 2017 +0100 @@ -1115,7 +1115,7 @@ # Complete the array with null values, permitting tests for a complete # set of arguments. - args += [None] * (not parameters and len(n.args) or parameters and len(parameters) or 0) + args += [None] * (parameters is None and len(n.args) or parameters is not None and len(parameters) or 0) kwcodes = [] kwargs = []