<html>
<head>
<base href="https://bugs.freedesktop.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - TypeError: __init__() got an unexpected keyword argument 'future_imports'"
href="https://bugs.freedesktop.org/show_bug.cgi?id=107565">107565</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>TypeError: __init__() got an unexpected keyword argument 'future_imports'
</td>
</tr>
<tr>
<th>Product</th>
<td>Mesa
</td>
</tr>
<tr>
<th>Version</th>
<td>git
</td>
</tr>
<tr>
<th>Hardware</th>
<td>x86-64 (AMD64)
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux (All)
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Keywords</th>
<td>bisected, regression
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>medium
</td>
</tr>
<tr>
<th>Component</th>
<td>Mesa core
</td>
</tr>
<tr>
<th>Assignee</th>
<td>mesa-dev@lists.freedesktop.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>vlee@freedesktop.org
</td>
</tr>
<tr>
<th>QA Contact</th>
<td>mesa-dev@lists.freedesktop.org
</td>
</tr>
<tr>
<th>CC</th>
<td>baker.dylan.c@gmail.com, bochecha@daitauha.fr, fdo-bugs@engestrom.ch
</td>
</tr></table>
<p>
<div>
<pre>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 <<a href="mailto:bochecha@daitauha.fr">bochecha@daitauha.fr</a>>
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 <<a href="mailto:bochecha@daitauha.fr">bochecha@daitauha.fr</a>>
Reviewed-by: Eric Engestrom <<a href="mailto:eric.engestrom@intel.com">eric.engestrom@intel.com</a>> (v2)
Reviewed-by: Dylan Baker <<a href="mailto:dylan@pnwbakers.com">dylan@pnwbakers.com</a>></pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
<li>You are the QA Contact for the bug.</li>
</ul>
</body>
</html>