import pkgutil


def get_resource(name: str) -> bytes:
    b = pkgutil.get_data(__package__, name)
    if b is None:
        raise Exception("no such embedded resource: %s" % name)
    assert type(b) == bytes  # todo: remove this
    return b


@@ -48,16 +48,29 @@
  bytes:%0A
+    try:%0A    
     b = 
@@ -113,20 +113,22 @@
     
-if b is None
+except OSError
 :%0A  
@@ -184,24 +184,133 @@
  %25s%22 %25 name)
+ from None%0A    if b is None:%0A        raise Exception(%22package cannot be located or loaded: %25s%22 %25 __package__)
 %0A    assert 
@@ -360,9 +360,8 @@
 eturn b%0A
-%0A

Fix get_resource error handling