Skip to content

Commit 73b4ee6

Browse files
committed
Explicitly specify break_on_hyphens=False in wrap()
Python 3.10 changed / fixed the `textwrap.wrap()` function's behavior, which we rely on for our `DataURI.wrap()` method. We need to explicitly specify `break_on_hyphens=False` in order to keep the previous behavior. This fixes unittests on Python 3.10.
1 parent 6666666 commit 73b4ee6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

datauri/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def __repr__(self):
6868
return "DataURI(%s)" % (super(DataURI, self).__repr__(),)
6969

7070
def wrap(self, width=76):
71-
return "\n".join(textwrap.wrap(self, width))
71+
return "\n".join(textwrap.wrap(self, width, break_on_hyphens=False))
7272

7373
@property
7474
def mimetype(self):

0 commit comments

Comments
 (0)