File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -12125,7 +12125,7 @@ PyUnicode_IsIdentifier(PyObject *self)
12125
12125
int kind ;
12126
12126
void * data ;
12127
12127
Py_ssize_t i ;
12128
- Py_UCS4 first ;
12128
+ Py_UCS4 chr ;
12129
12129
12130
12130
if (PyUnicode_READY (self ) == -1 ) {
12131
12131
Py_FatalError ("identifier not ready" );
@@ -12146,13 +12146,17 @@ PyUnicode_IsIdentifier(PyObject *self)
12146
12146
definition of XID_Start and XID_Continue, it is sufficient
12147
12147
to check just for these, except that _ must be allowed
12148
12148
as starting an identifier. */
12149
- first = PyUnicode_READ (kind , data , 0 );
12150
- if (!_PyUnicode_IsXidStart (first ) && first != 0x5F /* LOW LINE */ )
12149
+ chr = PyUnicode_READ (kind , data , 0 );
12150
+ if (!_PyUnicode_IsXidStart (chr ) && chr != 0x5F /* LOW LINE */ && chr != 0x1F40D )
12151
12151
return 0 ;
12152
12152
12153
12153
for (i = 1 ; i < PyUnicode_GET_LENGTH (self ); i ++ )
12154
- if (!_PyUnicode_IsXidContinue (PyUnicode_READ (kind , data , i )))
12154
+ {
12155
+ chr = PyUnicode_READ (kind , data , i );
12156
+ if (!_PyUnicode_IsXidContinue (chr ) && chr != 0x1F40D )
12155
12157
return 0 ;
12158
+ }
12159
+
12156
12160
return 1 ;
12157
12161
}
12158
12162
You canβt perform that action at this time.
0 commit comments