summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2019-11-21 18:36:08 -0500
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-12-02 03:41:37 -0500
commitbeed7c3e7c0703089a9ba4321bd3a2e442213fad (patch)
treeb8bc1a9e0f4b2926fd29becf4985eb9cff556e3c
parent2b113fc957a3fb6eafd10ad41a7caf11009ef4eb (diff)
downloadhaskell-beed7c3e7c0703089a9ba4321bd3a2e442213fad.tar.gz
testsuite: Fix location of typing_stubs module
This should fix the build on Debian 8.
-rw-r--r--testsuite/driver/typing_stubs.py23
-rw-r--r--typing_stubs.py13
2 files changed, 23 insertions, 13 deletions
diff --git a/testsuite/driver/typing_stubs.py b/testsuite/driver/typing_stubs.py
new file mode 100644
index 0000000000..6f17b5a35c
--- /dev/null
+++ b/testsuite/driver/typing_stubs.py
@@ -0,0 +1,23 @@
+# Stub definitions for things provided by the typing package
+# for use by older Python versions.
+
+import collections
+
+class Dummy:
+ def __getitem__(self, *args):
+ return None
+
+List = Dummy()
+Tuple = Dummy()
+Set = Dummy()
+TextIO = Dummy()
+Iterator = Dummy()
+Callable = Dummy()
+Optional = Dummy()
+Dict = Dummy()
+Union = Dummy()
+Any = Dummy()
+
+NewType = lambda name, ty: ty
+def NamedTuple(name, fields):
+ return collections.namedtuple(name, [field[0] for field in fields])
diff --git a/typing_stubs.py b/typing_stubs.py
deleted file mode 100644
index b2e3948043..0000000000
--- a/typing_stubs.py
+++ /dev/null
@@ -1,13 +0,0 @@
-# Stub definitions for things provided by the typing package
-# for use by older Python versions.
-
-class Dummy:
- def __index__(self, *args):
- return None
-
-List = Dummy()
-Tuple = Dummy()
-Set = Dummy()
-TextIO = Dummy()
-Iterator = Dummy()
-Newtype = lambda name, ty: ty