Skip to content

Commit 90a2180

Browse files
committed
TupleBuiltins: fix __getnewargs__ return value
1 parent 11e086e commit 90a2180

File tree

2 files changed

+20
-62
lines changed

2 files changed

+20
-62
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/tuple/TupleBuiltins.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ Object genericHash(@SuppressWarnings("unused") Object self) {
513513
public abstract static class GetNewargsNode extends PythonUnaryBuiltinNode {
514514
@Specialization
515515
PTuple doIt(PTuple self) {
516-
return factory().createTuple(self.getSequenceStorage());
516+
return factory().createTuple(new Object[]{factory().createTuple(self.getSequenceStorage())});
517517
}
518518
}
519519
}

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/parser/antlr/Python3Parser.java

Lines changed: 19 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -31,76 +31,34 @@
3131
// Generated from graalpython/com.oracle.graal.python/src/com/oracle/graal/python/parser/antlr/Python3.g4 by ANTLR 4.7.2
3232
package com.oracle.graal.python.parser.antlr;
3333

34-
import java.util.ArrayList;
35-
import java.util.Arrays;
36-
import java.util.List;
37-
38-
import org.antlr.v4.runtime.IntStream;
39-
import org.antlr.v4.runtime.NoViableAltException;
40-
import org.antlr.v4.runtime.Parser;
41-
import org.antlr.v4.runtime.ParserRuleContext;
42-
import org.antlr.v4.runtime.RecognitionException;
43-
import org.antlr.v4.runtime.Recognizer;
44-
import org.antlr.v4.runtime.RuntimeMetaData;
45-
import org.antlr.v4.runtime.Token;
46-
import org.antlr.v4.runtime.TokenStream;
47-
import org.antlr.v4.runtime.Vocabulary;
48-
import org.antlr.v4.runtime.VocabularyImpl;
49-
import org.antlr.v4.runtime.atn.ATN;
50-
import org.antlr.v4.runtime.atn.ATNDeserializer;
51-
import org.antlr.v4.runtime.atn.ParserATNSimulator;
52-
import org.antlr.v4.runtime.atn.PredictionContextCache;
53-
import org.antlr.v4.runtime.dfa.DFA;
54-
import org.antlr.v4.runtime.tree.RuleNode;
55-
import org.antlr.v4.runtime.tree.TerminalNode;
56-
34+
import com.oracle.graal.python.builtins.objects.ellipsis.PEllipsis;
35+
import com.oracle.graal.python.builtins.objects.PNone;
5736
import com.oracle.graal.python.builtins.PythonBuiltinClassType;
58-
import com.oracle.graal.python.nodes.ErrorMessages;
5937
import com.oracle.graal.python.nodes.expression.BinaryArithmetic;
6038
import com.oracle.graal.python.nodes.expression.UnaryArithmetic;
6139
import com.oracle.graal.python.nodes.statement.StatementNode;
6240
import com.oracle.graal.python.parser.PythonSSTNodeFactory;
6341
import com.oracle.graal.python.parser.ScopeEnvironment;
6442
import com.oracle.graal.python.parser.ScopeInfo;
65-
import com.oracle.graal.python.parser.sst.AndSSTNode;
66-
import com.oracle.graal.python.parser.sst.ArgDefListBuilder;
67-
import com.oracle.graal.python.parser.sst.ArgListBuilder;
68-
import com.oracle.graal.python.parser.sst.AssertSSTNode;
69-
import com.oracle.graal.python.parser.sst.BinaryArithmeticSSTNode;
70-
import com.oracle.graal.python.parser.sst.BlockSSTNode;
71-
import com.oracle.graal.python.parser.sst.BooleanLiteralSSTNode;
72-
import com.oracle.graal.python.parser.sst.CallSSTNode;
73-
import com.oracle.graal.python.parser.sst.CollectionSSTNode;
74-
import com.oracle.graal.python.parser.sst.ComparisonSSTNode;
75-
import com.oracle.graal.python.parser.sst.DecoratedSSTNode;
76-
import com.oracle.graal.python.parser.sst.DecoratorSSTNode;
77-
import com.oracle.graal.python.parser.sst.DelSSTNode;
78-
import com.oracle.graal.python.parser.sst.ExceptSSTNode;
79-
import com.oracle.graal.python.parser.sst.ExpressionStatementSSTNode;
80-
import com.oracle.graal.python.parser.sst.FloatLiteralSSTNode;
81-
import com.oracle.graal.python.parser.sst.ForComprehensionSSTNode;
82-
import com.oracle.graal.python.parser.sst.ForSSTNode;
83-
import com.oracle.graal.python.parser.sst.FunctionDefSSTNode;
84-
import com.oracle.graal.python.parser.sst.GetAttributeSSTNode;
85-
import com.oracle.graal.python.parser.sst.IfSSTNode;
86-
import com.oracle.graal.python.parser.sst.LambdaSSTNode;
87-
import com.oracle.graal.python.parser.sst.NotSSTNode;
88-
import com.oracle.graal.python.parser.sst.NumberLiteralSSTNode;
89-
import com.oracle.graal.python.parser.sst.OrSSTNode;
90-
import com.oracle.graal.python.parser.sst.RaiseSSTNode;
91-
import com.oracle.graal.python.parser.sst.SSTNode;
92-
import com.oracle.graal.python.parser.sst.SimpleSSTNode;
93-
import com.oracle.graal.python.parser.sst.SliceSSTNode;
94-
import com.oracle.graal.python.parser.sst.StarSSTNode;
95-
import com.oracle.graal.python.parser.sst.SubscriptSSTNode;
96-
import com.oracle.graal.python.parser.sst.TernaryIfSSTNode;
97-
import com.oracle.graal.python.parser.sst.TrySSTNode;
98-
import com.oracle.graal.python.parser.sst.UnarySSTNode;
99-
import com.oracle.graal.python.parser.sst.VarLookupSSTNode;
100-
import com.oracle.graal.python.parser.sst.WhileSSTNode;
43+
import com.oracle.graal.python.nodes.ErrorMessages;
44+
import com.oracle.graal.python.parser.sst.*;
10145
import com.oracle.graal.python.runtime.PythonParser.ParserMode;
46+
47+
import com.oracle.graal.python.parser.sst.SSTNode;
48+
10249
import com.oracle.truffle.api.frame.FrameDescriptor;
10350

51+
import java.util.Arrays;
52+
53+
import org.antlr.v4.runtime.atn.*;
54+
import org.antlr.v4.runtime.dfa.DFA;
55+
import org.antlr.v4.runtime.*;
56+
import org.antlr.v4.runtime.misc.*;
57+
import org.antlr.v4.runtime.tree.*;
58+
import java.util.List;
59+
import java.util.Iterator;
60+
import java.util.ArrayList;
61+
10462
@SuppressWarnings("all")
10563
public class Python3Parser extends Parser {
10664
static { RuntimeMetaData.checkVersion("4.7.2", RuntimeMetaData.VERSION); }
@@ -8320,7 +8278,7 @@ public final ArgumentContext argument(ArgListBuilder args) throws RecognitionExc
83208278
case 2:
83218279
enterOuterAlt(_localctx, 2);
83228280
{
8323-
8281+
83248282
String name = getCurrentToken().getText();
83258283
if (isForbiddenName(name)) {
83268284
factory.throwSyntaxError(getStartIndex(_localctx), getLastIndex(_localctx), ErrorMessages.CANNOT_ASSIGN_TO, name);

0 commit comments

Comments
 (0)