Skip to content

Commit

Permalink
[FIX] added dependancies
Browse files Browse the repository at this point in the history
  • Loading branch information
reactive-firewall committed Dec 21, 2021
1 parent ad79fce commit f30da9f
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions multicast/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.



__all__ = [
"""__package__""", """__module__""", """__name__""", """__version__""", """__prolog__""",
"""__doc__""", """__MCAST_DEFAULT_PORT""", """recv""", """send"""
Expand Down Expand Up @@ -116,6 +114,22 @@
raise ImportError(err)


try:
import socket
if socket.__name__ is None:
raise ImportError("FAIL: we could not import socket. ABORT.")
except Exception as err:
raise ImportError(err)


try:
import struct
if struct.__name__ is None:
raise ImportError("FAIL: we could not import struct. ABORT.")
except Exception as err:
raise ImportError(err)


try:
if 'multicast.recv' not in sys.modules:
from . import recv as recv
Expand All @@ -136,17 +150,18 @@
import multicast.recv as send


if __name__ in u'__main__':
if __name__ in '__main__':
try:
if 'multicast.__main__' not in sys.modules:
from . import pocket as pocket
from . import __main__ as __main__
else: # pragma: no branch
__main__ = sys.modules["""multicast.__main__"""]
except Exception:
from . import __main__ as __main__

if __name__ in '__main__':
__EXIT_CODE = 2
if __main__.__name__ is None:
raise ImportError(str("Failed to open multicast"))
__main__.main(sys.argv[1:])
exit(0)
__EXIT_CODE = __main__.main(sys.argv[1:])
exit(__EXIT_CODE)

0 comments on commit f30da9f

Please sign in to comment.