mirror of
https://github.com/nmap/nmap.git
synced 2025-12-07 21:21:31 +00:00
Remove unneeded use of deprecated imp module
This commit is contained in:
@@ -57,7 +57,6 @@
|
|||||||
# * *
|
# * *
|
||||||
# ***************************************************************************/
|
# ***************************************************************************/
|
||||||
|
|
||||||
import imp
|
|
||||||
import os
|
import os
|
||||||
import signal
|
import signal
|
||||||
import sys
|
import sys
|
||||||
@@ -135,14 +134,6 @@ def new_window():
|
|||||||
return w
|
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():
|
def is_root():
|
||||||
if 'NMAP_PRIVILEGED' in os.environ:
|
if 'NMAP_PRIVILEGED' in os.environ:
|
||||||
return True
|
return True
|
||||||
@@ -319,16 +310,8 @@ Do this now? \
|
|||||||
if target and profile:
|
if target and profile:
|
||||||
page.start_scan_cb()
|
page.start_scan_cb()
|
||||||
|
|
||||||
if main_is_frozen():
|
|
||||||
# This is needed by py2exe
|
|
||||||
Gdk.threads_init()
|
|
||||||
Gdk.threads_enter()
|
|
||||||
|
|
||||||
Gtk.main()
|
Gtk.main()
|
||||||
|
|
||||||
if main_is_frozen():
|
|
||||||
Gdk.threads_leave()
|
|
||||||
|
|
||||||
|
|
||||||
class NonRootWarning (HIGAlertDialog):
|
class NonRootWarning (HIGAlertDialog):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@@ -339,3 +322,6 @@ Some %s options need root privileges to work.''') % (
|
|||||||
|
|
||||||
HIGAlertDialog.__init__(self, message_format=_('Non-root user'),
|
HIGAlertDialog.__init__(self, message_format=_('Non-root user'),
|
||||||
secondary_text=warning_text)
|
secondary_text=warning_text)
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
run()
|
||||||
|
|||||||
Reference in New Issue
Block a user