Skip to content

Commit

Permalink
Fix loading of libglib on macOS
Browse files Browse the repository at this point in the history
libglib has the extension .dynlib on macOS.
  • Loading branch information
peturingi authored May 23, 2024
1 parent b699b35 commit 5ea7ddb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion dbusmock/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import argparse
import json
import os
import platform
import subprocess
import sys

Expand Down Expand Up @@ -160,7 +161,10 @@ def parse_args():
if args.template:
main_object.AddTemplate(args.template, parameters)

libglib = ctypes.cdll.LoadLibrary("libglib-2.0.so.0")
if platform.system() == "Darwin":
libglib = ctypes.cdll.LoadLibrary("libglib-2.0.dylib")
else:
libglib = ctypes.cdll.LoadLibrary("libglib-2.0.so.0")

dbusmock.mockobject.objects[args.path] = main_object

Expand Down

0 comments on commit 5ea7ddb

Please sign in to comment.