[Git][ghc/ghc][wip/junit-fixes] Fixes for old pythons

Ben Gamari gitlab at gitlab.haskell.org
Sat Jun 22 00:46:41 UTC 2019



Ben Gamari pushed to branch wip/junit-fixes at Glasgow Haskell Compiler / GHC


Commits:
96f0a668 by Ben Gamari at 2019-06-22T00:46:32Z
Fixes for old pythons

- - - - -


2 changed files:

- testsuite/driver/my_typing.py
- testsuite/driver/testlib.py


Changes:

=====================================
testsuite/driver/my_typing.py
=====================================
@@ -1,6 +1,16 @@
+"""
+This module provides some type definitions for use in the testsuite driver.
+The testsuite driver can be typechecked using mypy [1].
+
+
+[1] http://mypy-lang.org/
+"""
+
 try:
     from typing import *
 except:
+    # The backwards compatibility stubs must live in another module lest
+    # mypy complains.
     from typing_stubs import * # type: ignore
 
 WayName = NewType("WayName", str)


=====================================
testsuite/driver/testlib.py
=====================================
@@ -28,7 +28,7 @@ import perf_notes as Perf
 from perf_notes import MetricChange
 extra_src_files = {'T4198': ['exitminus1.c']} # TODO: See #12223
 
-from my_typing import * # type: ignore
+from my_typing import *
 
 global pool_sema
 if config.use_threads:
@@ -2238,7 +2238,7 @@ def findTFiles(roots: List[str]) -> Iterator[str]:
 # -----------------------------------------------------------------------------
 # Output a test summary to the specified file object
 
-def summary(t: TestRun, file: TextIO, short=False, color=False) -> None:
+def summary(t: TestRun, file: "TextIO", short=False, color=False) -> None:
 
     file.write('\n')
     printUnexpectedTests(file,



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/commit/96f0a6684601e1bd3764479d01118c4ca0b6aa35

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/commit/96f0a6684601e1bd3764479d01118c4ca0b6aa35
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20190621/60a9d6bb/attachment-0001.html>


More information about the ghc-commits mailing list