[Mesa-dev] [Bug 107565] TypeError: __init__() got an unexpected keyword argument 'future_imports'

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Aug 14 07:01:36 UTC 2018


https://bugs.freedesktop.org/show_bug.cgi?id=107565

            Bug ID: 107565
           Summary: TypeError: __init__() got an unexpected keyword
                    argument 'future_imports'
           Product: Mesa
           Version: git
          Hardware: x86-64 (AMD64)
                OS: Linux (All)
            Status: NEW
          Keywords: bisected, regression
          Severity: normal
          Priority: medium
         Component: Mesa core
          Assignee: mesa-dev at lists.freedesktop.org
          Reporter: vlee at freedesktop.org
        QA Contact: mesa-dev at lists.freedesktop.org
                CC: baker.dylan.c at gmail.com, bochecha at daitauha.fr,
                    fdo-bugs at engestrom.ch

Build error with Python 2.6.

  GEN    main/format_unpack.c
Traceback (most recent call last):
  File "./main/format_unpack.py", line 893, in <module>
    template = Template(string, future_imports=['division']);
TypeError: __init__() got an unexpected keyword argument 'future_imports'

commit 9b6746b7c0bef64be419c8cf2ecd916980e2718a
Author: Mathieu Bridon <bochecha at daitauha.fr>
Date:   Wed Jul 25 11:53:54 2018 +0200

    python: Use explicit integer divisions

    In Python 2, divisions of integers return an integer:

        >>> 32 / 4
        8

    In Python 3 though, they return floats:

        >>> 32 / 4
        8.0

    However, Python 3 has an explicit integer division operator:

        >>> 32 // 4
        8

    That operator exists on Python >= 2.2, so let's use it everywhere to
    make the scripts compatible with both Python 2 and 3.

    In addition, using __future__.division tells Python 2 to behave the same
    way as Python 3, which helps ensure the scripts produce the same output
    in both versions of Python.

    Signed-off-by: Mathieu Bridon <bochecha at daitauha.fr>
    Reviewed-by: Eric Engestrom <eric.engestrom at intel.com> (v2)
    Reviewed-by: Dylan Baker <dylan at pnwbakers.com>

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180814/3a81d242/attachment-0001.html>


More information about the mesa-dev mailing list