diff --git a/CHANGELOG b/CHANGELOG index 76e9acf5c..765d4dbaa 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,7 @@ #Nmap Changelog ($Id$); -*-text-*- +o Additional Python 3 update fixes by Sam James, Daniel Miller. + o [GH#1807][GH#1176][Ndiff] Updated Ndiff to Python 3. [Brian Quigley] o [GH#2088][GH#1176][Zenmap] Updated Zenmap to Python 3 and PyGObject. [Jakub KulĂ­k] diff --git a/ndiff/setup.py b/ndiff/setup.py index 427197c00..af2b6127d 100644 --- a/ndiff/setup.py +++ b/ndiff/setup.py @@ -155,13 +155,13 @@ Installing your distribution's python-dev package may solve this problem.""") #!/usr/bin/env python import errno, os, os.path, sys -print 'Uninstall %(name)s' +print('Uninstall %(name)s') answer = raw_input('Are you sure that you want to uninstall ' '%(name)s (yes/no) ') if answer != 'yes' and answer != 'y': - print 'Not uninstalling.' + print('Not uninstalling.') sys.exit(0) """ % {'name': APP_NAME} @@ -177,8 +177,8 @@ if answer != 'yes' and answer != 'y': # This should never happen (everything gets installed # inside the root), but if it does, be safe and don't # delete anything. - uninstaller += ("print '%s was not installed inside " - "the root %s; skipping.'\n" % (output, self.root)) + uninstaller += ("print('%s was not installed inside " + "the root %s; skipping.')\n" % (output, self.root)) continue output = path_strip_prefix(output, self.root) assert os.path.isabs(output) @@ -202,24 +202,24 @@ for path in INSTALLED_FILES: dirs.append(path) # Delete the files. for file in files: - print "Removing '%s'." % file + print("Removing '%s'." % file) try: os.remove(file) except OSError, e: - print >> sys.stderr, ' Error: %s.' % str(e) + print(' Error: %s.' % str(e), file=sys.stderr) # Delete the directories. First reverse-sort the normalized paths by # length so that child directories are deleted before their parents. dirs = [os.path.normpath(dir) for dir in dirs] dirs.sort(key = len, reverse = True) for dir in dirs: try: - print "Removing the directory '%s'." % dir + print("Removing the directory '%s'." % dir) os.rmdir(dir) except OSError, e: if e.errno == errno.ENOTEMPTY: - print "Directory '%s' not empty; not removing." % dir + print("Directory '%s' not empty; not removing." % dir) else: - print >> sys.stderr, str(e) + print(str(e), file=sys.stderr) """ uninstaller_file = open(uninstaller_filename, 'w') diff --git a/zenmap/setup.py b/zenmap/setup.py index c15412b3c..7b5f42719 100755 --- a/zenmap/setup.py +++ b/zenmap/setup.py @@ -215,13 +215,13 @@ class my_install(install): #!/usr/bin/env python3 import errno, os, os.path, sys -print 'Uninstall %(name)s %(version)s' +print('Uninstall %(name)s %(version)s') answer = raw_input('Are you sure that you want to uninstall ' '%(name)s %(version)s? (yes/no) ') if answer != 'yes' and answer != 'y': - print 'Not uninstalling.' + print('Not uninstalling.') sys.exit(0) """ % {'name': APP_DISPLAY_NAME, 'version': VERSION} @@ -237,8 +237,8 @@ if answer != 'yes' and answer != 'y': # This should never happen (everything gets installed # inside the root), but if it does, be safe and don't # delete anything. - uninstaller += ("print '%s was not installed inside " - "the root %s; skipping.'\n" % (output, self.root)) + uninstaller += ("print('%s was not installed inside " + "the root %s; skipping.')\n" % (output, self.root)) continue output = path_strip_prefix(output, self.root) assert os.path.isabs(output) @@ -262,24 +262,24 @@ for path in INSTALLED_FILES: dirs.append(path) # Delete the files. for file in files: - print "Removing '%s'." % file + print("Removing '%s'." % file) try: os.remove(file) except OSError as e: - print >> sys.stderr, ' Error: %s.' % str(e) + print(' Error: %s.' % str(e), file=sys.stderr) # Delete the directories. First reverse-sort the normalized paths by # length so that child directories are deleted before their parents. dirs = [os.path.normpath(dir) for dir in dirs] dirs.sort(key = len, reverse = True) for dir in dirs: try: - print "Removing the directory '%s'." % dir + print("Removing the directory '%s'." % dir) os.rmdir(dir) except OSError as e: if e.errno == errno.ENOTEMPTY: - print "Directory '%s' not empty; not removing." % dir + print("Directory '%s' not empty; not removing." % dir) else: - print >> sys.stderr, str(e) + print(str(e), file=sys.stderr) """ uninstaller_file = open(uninstaller_filename, 'w') @@ -419,7 +419,7 @@ for dir in dirs: with open(INSTALLED_FILES_NAME, "w") as f: for output in self.get_installed_files(): assert "\n" not in output - print >> f, output + print(output, file=f) class my_uninstall(Command):