1.1 --- a/generator.py Sun Jun 27 22:14:51 2021 +0200
1.2 +++ b/generator.py Tue Jun 29 22:24:48 2021 +0200
1.3 @@ -3,7 +3,7 @@
1.4 """
1.5 Generate C code from object layouts and other deduced information.
1.6
1.7 -Copyright (C) 2015, 2016, 2017, 2018, 2019 Paul Boddie <paul@boddie.org.uk>
1.8 +Copyright (C) 2015-2019, 2021 Paul Boddie <paul@boddie.org.uk>
1.9
1.10 This program is free software; you can redistribute it and/or modify it under
1.11 the terms of the GNU General Public License as published by the Free Software
1.12 @@ -51,7 +51,7 @@
1.13 string_type = "__builtins__.str.string"
1.14 tuple_type = "__builtins__.tuple.tuple"
1.15 type_type = "__builtins__.core.type"
1.16 - unicode_type = "__builtins__.unicode.utf8string"
1.17 + unicode_type = "__builtins__.unicode.unicode"
1.18
1.19 none_value = "__builtins__.none.None"
1.20
1.21 @@ -1265,14 +1265,14 @@
1.22
1.23 # Special-case the integer type.
1.24
1.25 + # Here, the __builtins__.int.new_int function is called with the
1.26 + # initialiser's parameter.
1.27 +
1.28 if path == self.int_type:
1.29 print >>f_code, """\
1.30 -__attr %s(__attr __self, __attr number_or_string)
1.31 +__attr %s(__attr __self, __attr number_or_string, __attr base)
1.32 {
1.33 - if (!__BOOL(__fn_native_int_is_int(__self, number_or_string)))
1.34 - __raise_value_error(number_or_string);
1.35 -
1.36 - return number_or_string;
1.37 + return __fn___builtins___int_new_int(__NULL, number_or_string, base);
1.38 }
1.39 """ % (
1.40 encode_instantiator_pointer(path),