From 5fd12db129a1f461a7b7f9a642226d752316d973 Mon Sep 17 00:00:00 2001 From: dmiller Date: Fri, 17 Mar 2023 16:51:38 +0000 Subject: [PATCH] Remove unneeded use of deprecated imp module --- zenmap/zenmapGUI/App.py | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/zenmap/zenmapGUI/App.py b/zenmap/zenmapGUI/App.py index bcfb37a34..e38ccd5fb 100644 --- a/zenmap/zenmapGUI/App.py +++ b/zenmap/zenmapGUI/App.py @@ -57,7 +57,6 @@ # * * # ***************************************************************************/ -import imp import os import signal import sys @@ -135,14 +134,6 @@ def new_window(): return w -# Script found at -# http://www.py2exe.org/index.cgi/HowToDetermineIfRunningFromExe -def main_is_frozen(): - return (hasattr(sys, "frozen") # new py2exe - or hasattr(sys, "importers") # old py2exe - or imp.is_frozen("__main__")) # tools/freeze - - def is_root(): if 'NMAP_PRIVILEGED' in os.environ: return True @@ -319,16 +310,8 @@ Do this now? \ if target and profile: page.start_scan_cb() - if main_is_frozen(): - # This is needed by py2exe - Gdk.threads_init() - Gdk.threads_enter() - Gtk.main() - if main_is_frozen(): - Gdk.threads_leave() - class NonRootWarning (HIGAlertDialog): def __init__(self): @@ -339,3 +322,6 @@ Some %s options need root privileges to work.''') % ( HIGAlertDialog.__init__(self, message_format=_('Non-root user'), secondary_text=warning_text) + +if __name__ == "__main__": + run()