From 7e344c975a6884d5ccadddfc2f7c1d1524de4033 Mon Sep 17 00:00:00 2001 From: PinkDev1 <5990@protonmail.com> Date: Thu, 25 Feb 2021 19:29:45 +0000 Subject: [PATCH] Added trycatch for netaddr import --- safeurl.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/safeurl.py b/safeurl.py index a9be918..da40ecd 100644 --- a/safeurl.py +++ b/safeurl.py @@ -13,7 +13,13 @@ from socket import gethostbyname_ex import re -import netaddr +try: + import netaddr +except: + # On more recent OS', the script won't be able to import the netaddr library without higher privileges. + print("You must run this script as root!") + exit() + import pycurl import StringIO