Skip to content

Commit 607a923

Browse files
committed
Refactor PyObjectLookupAttrNode to use SpecialMethodSlot.canBeSpecial().
1 parent 45526bd commit 607a923

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/lib/PyObjectLookupAttr.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ static final Object readAttributeQuickly(Object type, Object getattribute, Objec
323323
// the type. There may be a module-level __getattr__, however. Since that would be
324324
// a call anyway, we return to the generic code in that case
325325
String stringName = (String) name;
326-
if (!(stringName.charAt(0) == '_' && stringName.charAt(1) == '_')) {
326+
if (!SpecialMethodSlot.canBeSpecial(stringName)) {
327327
// not a special name, so this attribute cannot be on the module class
328328
ReadAttributeFromObjectNode readUncached = ReadAttributeFromObjectNode.getUncached();
329329
Object result = readUncached.execute(receiver, stringName);

0 commit comments

Comments
 (0)