Skip to content

Commit

Permalink
Patch the Python 3.6 copy module to support re
Browse files Browse the repository at this point in the history
  • Loading branch information
jwilges committed Apr 4, 2020
1 parent 49fa64b commit 4108a50
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drover/_copy_patch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"""Conditional patches for Python's `copy` module"""
import copy
import re
import sys

if sys.version_info < (3, 7):
# See: <https://stackoverflow.com/questions/6279305/typeerror-cannot-deepcopy-this-pattern-object>
copy._deepcopy_dispatch[type(re.compile(''))] = lambda r, _: r # pylint: disable=protected-access

0 comments on commit 4108a50

Please sign in to comment.