#33 Get rid of python2 stuff
Merged 3 years ago by jhutar. Opened 3 years ago by msuchy.
msuchy/rpmfluff dead  into  master

file modified
+6 -17
@@ -22,7 +22,7 @@ 

  and writing test cases for RPM tools e.g. yum

  """

  

- from __future__ import print_function

+ 

  

  import unittest

  import os
@@ -37,17 +37,6 @@ 

  

  CC = os.getenv("CC", "gcc")

  

- def _which(cmd):

-     """Hacked Python 3.3+ shutil.which() with limited functionality."""

-     path = os.environ.get("PATH", os.defpath)

-     for p in path.split(os.pathsep):

-         p = os.path.join(p, cmd)

-         if os.path.exists(p) and os.access(p, os.F_OK | os.X_OK):

-             return p

- 

- if sys.version_info < (3, 3):

-     shutil.which = _which

- 

  def _utf8_encode(s):

      """

      RPM now returns all string data as surrogate-escaped utf-8 strings
@@ -511,7 +500,7 @@ 

  - Initial version

  """

  

- sample_man_page = u""".TH FOO "1" "May 2009" "foo 1.00" "User Commands"

+ sample_man_page = """.TH FOO "1" "May 2009" "foo 1.00" "User Commands"

  .SH NAME

  foo \\- Frobnicates the doohickey

  .SH SYNOPSIS
@@ -760,9 +749,9 @@ 

  

      def gather_sources(self, sourcesDir):

          #print(self.sources)

-         for source in self.sources.values():

+         for source in list(self.sources.values()):

              source.write_file(sourcesDir)

-         for patch in self.patches.values():

+         for patch in list(self.patches.values()):

              patch.write_file(sourcesDir)

  

      def add_summary(self, summaryText):
@@ -2045,12 +2034,12 @@ 

          self.assertEqual('apache', group)

  

      def test_specfile_encoding_utf8(self):

-         self.rpmbuild.section_changelog = u"* Fri Mar 30 2001 Trond Eivind Glomsr\u00F8d <teg@redhat.com>\nDo something"

+         self.rpmbuild.section_changelog = "* Fri Mar 30 2001 Trond Eivind Glomsr\\u00F8d <teg@redhat.com>\nDo something"

          self.rpmbuild.make()

  

      def test_specfile_encoding_iso8859(self):

          self.rpmbuild.specfileEncoding = 'iso8859_10'

-         self.rpmbuild.section_changelog = u"* Fri Mar 30 2001 Trond Eivind Glomsr\u00F8d <teg@redhat.com>\nDo something"

+         self.rpmbuild.section_changelog = "* Fri Mar 30 2001 Trond Eivind Glomsr\\u00F8d <teg@redhat.com>\nDo something"

          self.rpmbuild.make()

  

      def test_epoch(self):

no initial comment

Pull-Request has been merged by jhutar

3 years ago
Metadata