[Git][reproducible-builds/diffoscope][master] 4 commits: Add an "eg." to the comment on stripping "original size modulo..." text to...

Chris Lamb gitlab at salsa.debian.org
Thu Aug 15 19:34:26 UTC 2019



Chris Lamb pushed to branch master at Reproducible Builds / diffoscope


Commits:
18e35260 by Chris Lamb at 2019-08-15T19:15:42Z
Add an "eg." to the comment on stripping "original size modulo..." text to emphasise that the actual numbers are not fixed.

Gbp-Dch: ignore

- - - - -
7e21926d by Chris Lamb at 2019-08-15T19:16:40Z
Drop literal "\n\nGbp-Dch: ignore" suffix from changelog entry.

I fail at shell, clearly.

Gbp-Dch: ignore

- - - - -
ec864434 by Chris Lamb at 2019-08-15T19:19:31Z
Reposition a comment regarding an exception within the indented block. This seems the more-common way of documentation such things, at least in Python.

Gbp-Dch: ignore

- - - - -
5261096d by Chris Lamb at 2019-08-15T19:28:21Z
No need to parse the section group from the class name; we can pass it via type(..)'s kwargs argument.

Gbp-Dch: ignore

- - - - -


3 changed files:

- debian/changelog
- diffoscope/comparators/elf.py
- diffoscope/comparators/utils/file.py


Changes:

=====================================
debian/changelog
=====================================
@@ -1,6 +1,6 @@
 diffoscope (121) UNRELEASED; urgency=medium
 
-  * WIP\n\nGbp-Dch: ignore
+  * WIP
 
  -- Chris Lamb <lamby at debian.org>  Mon, 29 Jul 2019 17:20:27 -0300
 


=====================================
diffoscope/comparators/elf.py
=====================================
@@ -147,23 +147,16 @@ class RedaelfVersionInfo(Readelf):
 
 
 class ReadelfDebugDump(Readelf):
-    def __new__(cls, *args, **kwargs):
-        # Find the section group from the class name
-        debug_section_group = cls.__name__[len('ReadelfDebugDump_') :]
-        if debug_section_group:
-            return ReadelfDebugDump(debug_section_group, *args, **kwargs)
-        return super(Readelf, cls).__new__(cls)
-
-    def __init__(self, debug_section_group, *args, **kwargs):
-        self._debug_section_group = debug_section_group
-        super().__init__(*args, **kwargs)
-
     def readelf_options(self):
         return ['--debug-dump=%s' % self._debug_section_group]
 
 
 READELF_DEBUG_DUMP_COMMANDS = [
-    type('ReadelfDebugDump_{}'.format(x), (ReadelfDebugDump,), {})
+    type(
+        'ReadelfDebugDump_{}'.format(x),
+        (ReadelfDebugDump,),
+        {'_debug_section_group': x},
+    )
     for x in DEBUG_SECTION_GROUPS
 ]
 
@@ -350,8 +343,8 @@ class ElfCodeSection(ElfSection):
                 other.path,
                 command_args=[self._name],
             )
-        # eg. When failing to disassemble a different architecture.
         except subprocess.CalledProcessError as e:
+            # eg. When failing to disassemble a different architecture.
             logger.error(e)
 
         if diff and not excluded:


=====================================
diffoscope/comparators/utils/file.py
=====================================
@@ -330,7 +330,7 @@ class File(object, metaclass=abc.ABCMeta):
 
     @classmethod
     def _mangle_file_type(self, val):
-        # Strip off trailing "original size modulo 2^32 671" from
+        # Strip off trailing (eg.) "original size modulo 2^32 671" from
         # gzip compressed data as this is just a symptom of the contents itself
         # changing that will be reflected elsewhere.
         if val.startswith("gzip compressed data"):



View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/compare/3ea473ad22f7ca258eab7e79f4360284592d2a31...5261096d1d10a765d4d7a93c718fc6ee0a49208b

-- 
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/compare/3ea473ad22f7ca258eab7e79f4360284592d2a31...5261096d1d10a765d4d7a93c718fc6ee0a49208b
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20190815/32dd3790/attachment.html>


More information about the rb-commits mailing list