Skip to content

Commit

Permalink
Handle exception in depcheck
Browse files Browse the repository at this point in the history
https://github.com/oaubert/advene/actions/runs/10583260889/job/29324863836 failed with

  File "D:/a/advene/advene/dev/win_installer/misc/depcheck.py", line 28, in _get_shared_libraries
    repo.require(namespace, version, 0)
gi.repository.GLib.GError: g-irepository-error-quark: Typelib file for namespace 'GIRepository', version '3.0' not found (0)

which is strange since GIRepository is 2.0.
  • Loading branch information
oaubert committed Aug 27, 2024
1 parent 86d1acb commit e4c7389
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions dev/win_installer/misc/depcheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,30 @@

def _get_shared_libraries(q, namespace, version):
repo = GIRepository.Repository()
repo.require(namespace, version, 0)
lib = repo.get_shared_library(namespace)
q.put(lib)
try:
repo.require(namespace, version, 0)
lib = repo.get_shared_library(namespace)
q.put(lib)
return True
except Exception as err:
print(f"Exception for {namespace}:{version}: {err.message}")
return False


@cache
def get_shared_libraries(namespace, version):
# we have to start a new process because multiple versions can't be loaded
# in the same process
q = Queue()
p = Process(target=_get_shared_libraries, args=(q, namespace, version))
p.start()
result = q.get()
p.join()
return result
ret = _get_shared_libraries, args=(q, namespace, version)
if ret:
p = Process(target=ret)
p.start()
result = q.get()
p.join()
return result
else:
return None


def get_required_by_typelibs():
Expand Down

0 comments on commit e4c7389

Please sign in to comment.