Kaydet (Commit) 82a9b60b authored tarafından Jack Jansen's avatar Jack Jansen

Use PyString_CHECK_INTERNED.

üst 8ba42206
...@@ -79,14 +79,14 @@ findnamedresource( ...@@ -79,14 +79,14 @@ findnamedresource(
static int max_not_a_file = 0; static int max_not_a_file = 0;
int i; int i;
if (obj && obj->ob_sinterned ) { if (obj && PyString_Check(obj) && PyString_CHECK_INTERNED(obj) ) {
for( i=0; i< max_not_a_file; i++ ) for( i=0; i< max_not_a_file; i++ )
if ( obj == not_a_file[i] ) if ( obj == not_a_file[i] )
return 0; return 0;
} }
if ( FSMakeFSSpec(0, 0, Pstring(filename), &fss) != noErr ) { if ( FSMakeFSSpec(0, 0, Pstring(filename), &fss) != noErr ) {
/* doesn't exist or is folder */ /* doesn't exist or is folder */
if ( obj && max_not_a_file < MAXPATHCOMPONENTS && obj->ob_sinterned ) { if ( obj && max_not_a_file < MAXPATHCOMPONENTS && PyString_Check(obj) && PyString_CHECK_INTERNED(obj) ) {
Py_INCREF(obj); Py_INCREF(obj);
not_a_file[max_not_a_file++] = obj; not_a_file[max_not_a_file++] = obj;
if (Py_VerboseFlag > 1) if (Py_VerboseFlag > 1)
...@@ -106,7 +106,7 @@ findnamedresource( ...@@ -106,7 +106,7 @@ findnamedresource(
} else { } else {
if ( FSpGetFInfo(&fss, &finfo) != noErr ) { if ( FSpGetFInfo(&fss, &finfo) != noErr ) {
/* doesn't exist or is folder */ /* doesn't exist or is folder */
if ( obj && max_not_a_file < MAXPATHCOMPONENTS && obj->ob_sinterned ) { if ( obj && max_not_a_file < MAXPATHCOMPONENTS && PyString_Check(obj) && PyString_CHECK_INTERNED(obj) ) {
Py_INCREF(obj); Py_INCREF(obj);
not_a_file[max_not_a_file++] = obj; not_a_file[max_not_a_file++] = obj;
if (Py_VerboseFlag > 1) if (Py_VerboseFlag > 1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment