Skip to content

Commit

Permalink
Added dlopen error to printf output
Browse files Browse the repository at this point in the history
  • Loading branch information
Zen-CODE committed Oct 31, 2016
1 parent 3217ea2 commit e31b299
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pyobjus/_runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,16 @@ static void pyobjc_internal_init() {
foundation = dlopen(
"/System/Library/Frameworks/Foundation.framework/Versions/Current/Foundation", RTLD_LAZY);
if ( foundation == NULL ) {
// Load from the most likely path fails. Log and try alternative
char *msg = dlerror();
printf("Got dlopen error on Foundation: %s\n", msg);

foundation = dlopen(
"/Groups/System/Library/Frameworks/Foundation.framework/Versions/Current/Foundation", RTLD_LAZY);
if ( foundation == NULL ) {
printf("Got dlopen error on Foundation\n");
// 2nd fail
msg = dlerror();
printf("Got fallback dlopen error on Foundation: %s\n", msg);
return;
}
}
Expand Down

0 comments on commit e31b299

Please sign in to comment.