From: Michael R. Crusoe <crusoe@debian.org>
Subject: Add Python 3.9 compatibility
Forwarded: https://github.com/cogent3/cogent3/pull/850
--- python-cogent.orig/src/cogent3/util/union_dict.py
+++ python-cogent/src/cogent3/util/union_dict.py
@@ -2,7 +2,7 @@
 """UnionDict extension of dict.
 """
 from cogent3.util.misc import extend_docstring_from
-
+import sys
 
 __author__ = "Thomas La"
 __copyright__ = "Copyright 2007-2020, The Cogent Project"
@@ -64,6 +64,14 @@
         self.union(other)
         return self
 
+    if sys.version_info[:2] == (3, 9):
+        def __ror__(self, other):
+            other.union(self)
+            return other
+
+        def __ior__(self, other):
+            return self.__or__(other)
+
     def union(self, other):
         """returns the union of self with other
 
