We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
s390x: test_python2/test_python2_unicode_literals can't assign to () INTERNAL ERROR
During the build of 19.10b0 in Fedora, the following test failure occurs on s390x (Big Endian) architecture:

```
======================================================================
FAIL: test_python2 (tests.test_black.BlackTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/black-19.10b0/black.py", line 3754, in assert_equivalent
    src_ast = parse_ast(src)
  File "/builddir/build/BUILD/black-19.10b0/black.py", line 3686, in parse_ast
    return ast27.parse(src)
  File "/usr/lib64/python3.8/site-packages/typed_ast/ast27.py", line 50, in parse
    return _ast27.parse(source, filename, mode)
  File "<unknown>", line 10
SyntaxError: can't assign to ()
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/lib64/python3.8/unittest/mock.py", line 1342, in patched
    return func(*newargs, **newkeywargs)
  File "/builddir/build/BUILD/black-19.10b0/tests/test_black.py", line 543, in test_python2
    black.assert_equivalent(source, actual)
  File "/builddir/build/BUILD/black-19.10b0/black.py", line 3756, in assert_equivalent
    raise AssertionError(
AssertionError: cannot use --safe with this file; failed to parse source file.  AST error message: can't assign to () (<unknown>, line 10)
======================================================================
FAIL: test_python2_unicode_literals (tests.test_black.BlackTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib64/python3.8/unittest/mock.py", line 1342, in patched
    return func(*newargs, **newkeywargs)
  File "/builddir/build/BUILD/black-19.10b0/tests/test_black.py", line 560, in test_python2_unicode_literals
    black.assert_equivalent(source, actual)
  File "/builddir/build/BUILD/black-19.10b0/black.py", line 3775, in assert_equivalent
    raise AssertionError(
AssertionError: INTERNAL ERROR: Black produced code that is not equivalent to the source.  Please report a bug on https://github.com/psf/black/issues.  This diff might be helpful: 
--- src
+++ dst
@@ -1,4 +1,70 @@
 Module(
   body=
+    ImportFrom(
+      level=
+        0,  # int
+      module=
+        '__future__',  # str
+      names=
+        alias(
+          asname=
+            '_unicode_literals',  # str
+          name=
+            'unicode_literals',  # str
+        )  # /alias
+    )  # /ImportFrom
+    ImportFrom(
+      level=
+        0,  # int
+      module=
+        '__future__',  # str
+      names=
+        alias(
+          asname=
+            None,  # NoneType
+          name=
+            'absolute_import',  # str
+        )  # /alias
+    )  # /ImportFrom
+    ImportFrom(
+      level=
+        0,  # int
+      module=
+        '__future__',  # str
+      names=
+        alias(
+          asname=
+            'lol',  # str
+          name=
+            'print_function',  # str
+        )  # /alias
+        alias(
+          asname=
+            None,  # NoneType
+          name=
+            'with_function',  # str
+        )  # /alias
+    )  # /ImportFrom
+    Expr(
+      value=
+        Constant(
+          value=
+            'hello',  # str
+        )  # /Constant
+    )  # /Expr
+    Expr(
+      value=
+        Constant(
+          value=
+            'hello',  # str
+        )  # /Constant
+    )  # /Expr
+    Expr(
+      value=
+        Constant(
+          value=
+            'hello',  # str
+        )  # /Constant
+    )  # /Expr
   type_ignores=
 )  # /Module
----------------------------------------------------------------------
Ran 119 tests in 18.012s
FAILED (failures=2)
```

**To Reproduce**, run the test suite on s390x. 

Here is the build log with all the commands: [build.log](https://github.com/psf/black/files/3782557/build.log)

Here is the root log with all the package versions: [root.log](https://github.com/psf/black/files/3782561/root.log)


**Expected behavior**
Test succeed an all architectures.

**Environment:**

- Version: 19.10b0
- OS and Python version: Linux, Fedora 32 on s390x, Python 3.8.0

**Does this bug also happen on master?** yes, on 6bedb5c58a7d8c25aa9509f8217bc24e9797e90d

**Additional context** The problem does not happen on the same build system with armv7hl or ppc64le.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `setup.py`
Content:
```
1 # Copyright (C) 2020 Łukasz Langa
2 from setuptools import setup
3 import sys
4 import os
5 
6 assert sys.version_info >= (3, 6, 0), "black requires Python 3.6+"
7 from pathlib import Path  # noqa E402
8 
9 CURRENT_DIR = Path(__file__).parent
10 sys.path.insert(0, str(CURRENT_DIR))  # for setuptools.build_meta
11 
12 
13 def get_long_description() -> str:
14     return (
15         (CURRENT_DIR / "README.md").read_text(encoding="utf8")
16         + "\n\n"
17         + (CURRENT_DIR / "CHANGES.md").read_text(encoding="utf8")
18     )
19 
20 
21 USE_MYPYC = False
22 # To compile with mypyc, a mypyc checkout must be present on the PYTHONPATH
23 if len(sys.argv) > 1 and sys.argv[1] == "--use-mypyc":
24     sys.argv.pop(1)
25     USE_MYPYC = True
26 if os.getenv("BLACK_USE_MYPYC", None) == "1":
27     USE_MYPYC = True
28 
29 if USE_MYPYC:
30     mypyc_targets = [
31         "src/black/__init__.py",
32         "src/blib2to3/pytree.py",
33         "src/blib2to3/pygram.py",
34         "src/blib2to3/pgen2/parse.py",
35         "src/blib2to3/pgen2/grammar.py",
36         "src/blib2to3/pgen2/token.py",
37         "src/blib2to3/pgen2/driver.py",
38         "src/blib2to3/pgen2/pgen.py",
39     ]
40 
41     from mypyc.build import mypycify
42 
43     opt_level = os.getenv("MYPYC_OPT_LEVEL", "3")
44     ext_modules = mypycify(mypyc_targets, opt_level=opt_level)
45 else:
46     ext_modules = []
47 
48 setup(
49     name="black",
50     use_scm_version={
51         "write_to": "src/_black_version.py",
52         "write_to_template": 'version = "{version}"\n',
53     },
54     description="The uncompromising code formatter.",
55     long_description=get_long_description(),
56     long_description_content_type="text/markdown",
57     keywords="automation formatter yapf autopep8 pyfmt gofmt rustfmt",
58     author="Łukasz Langa",
59     author_email="lukasz@langa.pl",
60     url="https://github.com/psf/black",
61     project_urls={"Changelog": "https://github.com/psf/black/blob/master/CHANGES.md"},
62     license="MIT",
63     py_modules=["_black_version"],
64     ext_modules=ext_modules,
65     packages=["blackd", "black", "blib2to3", "blib2to3.pgen2", "black_primer"],
66     package_dir={"": "src"},
67     package_data={"blib2to3": ["*.txt"], "black": ["py.typed"]},
68     python_requires=">=3.6",
69     zip_safe=False,
70     install_requires=[
71         "click>=7.1.2",
72         "appdirs",
73         "toml>=0.10.1",
74         "typed-ast>=1.4.0",
75         "regex>=2020.1.8",
76         "pathspec>=0.6, <1",
77         "dataclasses>=0.6; python_version < '3.7'",
78         "typing_extensions>=3.7.4",
79         "mypy_extensions>=0.4.3",
80     ],
81     extras_require={
82         "d": ["aiohttp>=3.3.2", "aiohttp-cors"],
83         "colorama": ["colorama>=0.4.3"],
84     },
85     test_suite="tests.test_black",
86     classifiers=[
87         "Development Status :: 4 - Beta",
88         "Environment :: Console",
89         "Intended Audience :: Developers",
90         "License :: OSI Approved :: MIT License",
91         "Operating System :: OS Independent",
92         "Programming Language :: Python",
93         "Programming Language :: Python :: 3.6",
94         "Programming Language :: Python :: 3.7",
95         "Programming Language :: Python :: 3.8",
96         "Programming Language :: Python :: 3.9",
97         "Programming Language :: Python :: 3 :: Only",
98         "Topic :: Software Development :: Libraries :: Python Modules",
99         "Topic :: Software Development :: Quality Assurance",
100     ],
101     entry_points={
102         "console_scripts": [
103             "black=black:patched_main",
104             "blackd=blackd:patched_main [d]",
105             "black-primer=black_primer.cli:main",
106         ]
107     },
108 )
109
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -71,7 +71,7 @@
         "click>=7.1.2",
         "appdirs",
         "toml>=0.10.1",
-        "typed-ast>=1.4.0",
+        "typed-ast>=1.4.2",
         "regex>=2020.1.8",
         "pathspec>=0.6, <1",
         "dataclasses>=0.6; python_version < '3.7'",

{"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -71,7 +71,7 @@\n         \"click>=7.1.2\",\n         \"appdirs\",\n         \"toml>=0.10.1\",\n-        \"typed-ast>=1.4.0\",\n+        \"typed-ast>=1.4.2\",\n         \"regex>=2020.1.8\",\n         \"pathspec>=0.6, <1\",\n         \"dataclasses>=0.6; python_version < '3.7'\",\n", "issue": "s390x: test_python2/test_python2_unicode_literals can't assign to () INTERNAL ERROR\nDuring the build of 19.10b0 in Fedora, the following test failure occurs on s390x (Big Endian) architecture:\r\n\r\n```\r\n======================================================================\r\nFAIL: test_python2 (tests.test_black.BlackTestCase)\r\n----------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n  File \"/builddir/build/BUILD/black-19.10b0/black.py\", line 3754, in assert_equivalent\r\n    src_ast = parse_ast(src)\r\n  File \"/builddir/build/BUILD/black-19.10b0/black.py\", line 3686, in parse_ast\r\n    return ast27.parse(src)\r\n  File \"/usr/lib64/python3.8/site-packages/typed_ast/ast27.py\", line 50, in parse\r\n    return _ast27.parse(source, filename, mode)\r\n  File \"<unknown>\", line 10\r\nSyntaxError: can't assign to ()\r\nDuring handling of the above exception, another exception occurred:\r\nTraceback (most recent call last):\r\n  File \"/usr/lib64/python3.8/unittest/mock.py\", line 1342, in patched\r\n    return func(*newargs, **newkeywargs)\r\n  File \"/builddir/build/BUILD/black-19.10b0/tests/test_black.py\", line 543, in test_python2\r\n    black.assert_equivalent(source, actual)\r\n  File \"/builddir/build/BUILD/black-19.10b0/black.py\", line 3756, in assert_equivalent\r\n    raise AssertionError(\r\nAssertionError: cannot use --safe with this file; failed to parse source file.  AST error message: can't assign to () (<unknown>, line 10)\r\n======================================================================\r\nFAIL: test_python2_unicode_literals (tests.test_black.BlackTestCase)\r\n----------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n  File \"/usr/lib64/python3.8/unittest/mock.py\", line 1342, in patched\r\n    return func(*newargs, **newkeywargs)\r\n  File \"/builddir/build/BUILD/black-19.10b0/tests/test_black.py\", line 560, in test_python2_unicode_literals\r\n    black.assert_equivalent(source, actual)\r\n  File \"/builddir/build/BUILD/black-19.10b0/black.py\", line 3775, in assert_equivalent\r\n    raise AssertionError(\r\nAssertionError: INTERNAL ERROR: Black produced code that is not equivalent to the source.  Please report a bug on https://github.com/psf/black/issues.  This diff might be helpful: \r\n--- src\r\n+++ dst\r\n@@ -1,4 +1,70 @@\r\n Module(\r\n   body=\r\n+    ImportFrom(\r\n+      level=\r\n+        0,  # int\r\n+      module=\r\n+        '__future__',  # str\r\n+      names=\r\n+        alias(\r\n+          asname=\r\n+            '_unicode_literals',  # str\r\n+          name=\r\n+            'unicode_literals',  # str\r\n+        )  # /alias\r\n+    )  # /ImportFrom\r\n+    ImportFrom(\r\n+      level=\r\n+        0,  # int\r\n+      module=\r\n+        '__future__',  # str\r\n+      names=\r\n+        alias(\r\n+          asname=\r\n+            None,  # NoneType\r\n+          name=\r\n+            'absolute_import',  # str\r\n+        )  # /alias\r\n+    )  # /ImportFrom\r\n+    ImportFrom(\r\n+      level=\r\n+        0,  # int\r\n+      module=\r\n+        '__future__',  # str\r\n+      names=\r\n+        alias(\r\n+          asname=\r\n+            'lol',  # str\r\n+          name=\r\n+            'print_function',  # str\r\n+        )  # /alias\r\n+        alias(\r\n+          asname=\r\n+            None,  # NoneType\r\n+          name=\r\n+            'with_function',  # str\r\n+        )  # /alias\r\n+    )  # /ImportFrom\r\n+    Expr(\r\n+      value=\r\n+        Constant(\r\n+          value=\r\n+            'hello',  # str\r\n+        )  # /Constant\r\n+    )  # /Expr\r\n+    Expr(\r\n+      value=\r\n+        Constant(\r\n+          value=\r\n+            'hello',  # str\r\n+        )  # /Constant\r\n+    )  # /Expr\r\n+    Expr(\r\n+      value=\r\n+        Constant(\r\n+          value=\r\n+            'hello',  # str\r\n+        )  # /Constant\r\n+    )  # /Expr\r\n   type_ignores=\r\n )  # /Module\r\n----------------------------------------------------------------------\r\nRan 119 tests in 18.012s\r\nFAILED (failures=2)\r\n```\r\n\r\n**To Reproduce**, run the test suite on s390x. \r\n\r\nHere is the build log with all the commands: [build.log](https://github.com/psf/black/files/3782557/build.log)\r\n\r\nHere is the root log with all the package versions: [root.log](https://github.com/psf/black/files/3782561/root.log)\r\n\r\n\r\n**Expected behavior**\r\nTest succeed an all architectures.\r\n\r\n**Environment:**\r\n\r\n- Version: 19.10b0\r\n- OS and Python version: Linux, Fedora 32 on s390x, Python 3.8.0\r\n\r\n**Does this bug also happen on master?** yes, on 6bedb5c58a7d8c25aa9509f8217bc24e9797e90d\r\n\r\n**Additional context** The problem does not happen on the same build system with armv7hl or ppc64le.\r\n\n", "before_files": [{"content": "# Copyright (C) 2020 \u0141ukasz Langa\nfrom setuptools import setup\nimport sys\nimport os\n\nassert sys.version_info >= (3, 6, 0), \"black requires Python 3.6+\"\nfrom pathlib import Path  # noqa E402\n\nCURRENT_DIR = Path(__file__).parent\nsys.path.insert(0, str(CURRENT_DIR))  # for setuptools.build_meta\n\n\ndef get_long_description() -> str:\n    return (\n        (CURRENT_DIR / \"README.md\").read_text(encoding=\"utf8\")\n        + \"\\n\\n\"\n        + (CURRENT_DIR / \"CHANGES.md\").read_text(encoding=\"utf8\")\n    )\n\n\nUSE_MYPYC = False\n# To compile with mypyc, a mypyc checkout must be present on the PYTHONPATH\nif len(sys.argv) > 1 and sys.argv[1] == \"--use-mypyc\":\n    sys.argv.pop(1)\n    USE_MYPYC = True\nif os.getenv(\"BLACK_USE_MYPYC\", None) == \"1\":\n    USE_MYPYC = True\n\nif USE_MYPYC:\n    mypyc_targets = [\n        \"src/black/__init__.py\",\n        \"src/blib2to3/pytree.py\",\n        \"src/blib2to3/pygram.py\",\n        \"src/blib2to3/pgen2/parse.py\",\n        \"src/blib2to3/pgen2/grammar.py\",\n        \"src/blib2to3/pgen2/token.py\",\n        \"src/blib2to3/pgen2/driver.py\",\n        \"src/blib2to3/pgen2/pgen.py\",\n    ]\n\n    from mypyc.build import mypycify\n\n    opt_level = os.getenv(\"MYPYC_OPT_LEVEL\", \"3\")\n    ext_modules = mypycify(mypyc_targets, opt_level=opt_level)\nelse:\n    ext_modules = []\n\nsetup(\n    name=\"black\",\n    use_scm_version={\n        \"write_to\": \"src/_black_version.py\",\n        \"write_to_template\": 'version = \"{version}\"\\n',\n    },\n    description=\"The uncompromising code formatter.\",\n    long_description=get_long_description(),\n    long_description_content_type=\"text/markdown\",\n    keywords=\"automation formatter yapf autopep8 pyfmt gofmt rustfmt\",\n    author=\"\u0141ukasz Langa\",\n    author_email=\"lukasz@langa.pl\",\n    url=\"https://github.com/psf/black\",\n    project_urls={\"Changelog\": \"https://github.com/psf/black/blob/master/CHANGES.md\"},\n    license=\"MIT\",\n    py_modules=[\"_black_version\"],\n    ext_modules=ext_modules,\n    packages=[\"blackd\", \"black\", \"blib2to3\", \"blib2to3.pgen2\", \"black_primer\"],\n    package_dir={\"\": \"src\"},\n    package_data={\"blib2to3\": [\"*.txt\"], \"black\": [\"py.typed\"]},\n    python_requires=\">=3.6\",\n    zip_safe=False,\n    install_requires=[\n        \"click>=7.1.2\",\n        \"appdirs\",\n        \"toml>=0.10.1\",\n        \"typed-ast>=1.4.0\",\n        \"regex>=2020.1.8\",\n        \"pathspec>=0.6, <1\",\n        \"dataclasses>=0.6; python_version < '3.7'\",\n        \"typing_extensions>=3.7.4\",\n        \"mypy_extensions>=0.4.3\",\n    ],\n    extras_require={\n        \"d\": [\"aiohttp>=3.3.2\", \"aiohttp-cors\"],\n        \"colorama\": [\"colorama>=0.4.3\"],\n    },\n    test_suite=\"tests.test_black\",\n    classifiers=[\n        \"Development Status :: 4 - Beta\",\n        \"Environment :: Console\",\n        \"Intended Audience :: Developers\",\n        \"License :: OSI Approved :: MIT License\",\n        \"Operating System :: OS Independent\",\n        \"Programming Language :: Python\",\n        \"Programming Language :: Python :: 3.6\",\n        \"Programming Language :: Python :: 3.7\",\n        \"Programming Language :: Python :: 3.8\",\n        \"Programming Language :: Python :: 3.9\",\n        \"Programming Language :: Python :: 3 :: Only\",\n        \"Topic :: Software Development :: Libraries :: Python Modules\",\n        \"Topic :: Software Development :: Quality Assurance\",\n    ],\n    entry_points={\n        \"console_scripts\": [\n            \"black=black:patched_main\",\n            \"blackd=blackd:patched_main [d]\",\n            \"black-primer=black_primer.cli:main\",\n        ]\n    },\n)\n", "path": "setup.py"}], "after_files": [{"content": "# Copyright (C) 2020 \u0141ukasz Langa\nfrom setuptools import setup\nimport sys\nimport os\n\nassert sys.version_info >= (3, 6, 0), \"black requires Python 3.6+\"\nfrom pathlib import Path  # noqa E402\n\nCURRENT_DIR = Path(__file__).parent\nsys.path.insert(0, str(CURRENT_DIR))  # for setuptools.build_meta\n\n\ndef get_long_description() -> str:\n    return (\n        (CURRENT_DIR / \"README.md\").read_text(encoding=\"utf8\")\n        + \"\\n\\n\"\n        + (CURRENT_DIR / \"CHANGES.md\").read_text(encoding=\"utf8\")\n    )\n\n\nUSE_MYPYC = False\n# To compile with mypyc, a mypyc checkout must be present on the PYTHONPATH\nif len(sys.argv) > 1 and sys.argv[1] == \"--use-mypyc\":\n    sys.argv.pop(1)\n    USE_MYPYC = True\nif os.getenv(\"BLACK_USE_MYPYC\", None) == \"1\":\n    USE_MYPYC = True\n\nif USE_MYPYC:\n    mypyc_targets = [\n        \"src/black/__init__.py\",\n        \"src/blib2to3/pytree.py\",\n        \"src/blib2to3/pygram.py\",\n        \"src/blib2to3/pgen2/parse.py\",\n        \"src/blib2to3/pgen2/grammar.py\",\n        \"src/blib2to3/pgen2/token.py\",\n        \"src/blib2to3/pgen2/driver.py\",\n        \"src/blib2to3/pgen2/pgen.py\",\n    ]\n\n    from mypyc.build import mypycify\n\n    opt_level = os.getenv(\"MYPYC_OPT_LEVEL\", \"3\")\n    ext_modules = mypycify(mypyc_targets, opt_level=opt_level)\nelse:\n    ext_modules = []\n\nsetup(\n    name=\"black\",\n    use_scm_version={\n        \"write_to\": \"src/_black_version.py\",\n        \"write_to_template\": 'version = \"{version}\"\\n',\n    },\n    description=\"The uncompromising code formatter.\",\n    long_description=get_long_description(),\n    long_description_content_type=\"text/markdown\",\n    keywords=\"automation formatter yapf autopep8 pyfmt gofmt rustfmt\",\n    author=\"\u0141ukasz Langa\",\n    author_email=\"lukasz@langa.pl\",\n    url=\"https://github.com/psf/black\",\n    project_urls={\"Changelog\": \"https://github.com/psf/black/blob/master/CHANGES.md\"},\n    license=\"MIT\",\n    py_modules=[\"_black_version\"],\n    ext_modules=ext_modules,\n    packages=[\"blackd\", \"black\", \"blib2to3\", \"blib2to3.pgen2\", \"black_primer\"],\n    package_dir={\"\": \"src\"},\n    package_data={\"blib2to3\": [\"*.txt\"], \"black\": [\"py.typed\"]},\n    python_requires=\">=3.6\",\n    zip_safe=False,\n    install_requires=[\n        \"click>=7.1.2\",\n        \"appdirs\",\n        \"toml>=0.10.1\",\n        \"typed-ast>=1.4.2\",\n        \"regex>=2020.1.8\",\n        \"pathspec>=0.6, <1\",\n        \"dataclasses>=0.6; python_version < '3.7'\",\n        \"typing_extensions>=3.7.4\",\n        \"mypy_extensions>=0.4.3\",\n    ],\n    extras_require={\n        \"d\": [\"aiohttp>=3.3.2\", \"aiohttp-cors\"],\n        \"colorama\": [\"colorama>=0.4.3\"],\n    },\n    test_suite=\"tests.test_black\",\n    classifiers=[\n        \"Development Status :: 4 - Beta\",\n        \"Environment :: Console\",\n        \"Intended Audience :: Developers\",\n        \"License :: OSI Approved :: MIT License\",\n        \"Operating System :: OS Independent\",\n        \"Programming Language :: Python\",\n        \"Programming Language :: Python :: 3.6\",\n        \"Programming Language :: Python :: 3.7\",\n        \"Programming Language :: Python :: 3.8\",\n        \"Programming Language :: Python :: 3.9\",\n        \"Programming Language :: Python :: 3 :: Only\",\n        \"Topic :: Software Development :: Libraries :: Python Modules\",\n        \"Topic :: Software Development :: Quality Assurance\",\n    ],\n    entry_points={\n        \"console_scripts\": [\n            \"black=black:patched_main\",\n            \"blackd=blackd:patched_main [d]\",\n            \"black-primer=black_primer.cli:main\",\n        ]\n    },\n)\n", "path": "setup.py"}]}