From 68c0eaa7db54d91cb0c51a7f653a97bc1d3ccd50 Mon Sep 17 00:00:00 2001 From: Fredrik Tolf Date: Sun, 28 Aug 2022 12:49:08 +0200 Subject: [PATCH] Fixed ABC import compatibility for Python 3.8. --- wrw/proto.py | 8 ++++---- wrw/sp/cons.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/wrw/proto.py b/wrw/proto.py index a30b8bf..2438c7c 100644 --- a/wrw/proto.py +++ b/wrw/proto.py @@ -1,4 +1,4 @@ -import time, calendar, collections, binascii, base64 +import time, calendar, collections.abc, binascii, base64 statusinfo = { 400: ("Bad Request", "Invalid HTTP request."), @@ -210,7 +210,7 @@ def parurl(url, pars={}, **augment): def enhex(bs): return base64.b16encode(bs).decode("us-ascii") def unhex(es): - if not isinstance(es, collections.ByteString): + if not isinstance(es, collections.abc.ByteString): try: es = es.encode("us-ascii") except UnicodeError: @@ -219,7 +219,7 @@ def unhex(es): def enb32(bs): return base64.b32encode(bs).decode("us-ascii") def unb32(es): - if not isinstance(es, collections.ByteString): + if not isinstance(es, collections.abc.ByteString): try: es = es.encode("us-ascii") except UnicodeError: @@ -231,7 +231,7 @@ def unb32(es): def enb64(bs): return base64.b64encode(bs).decode("us-ascii") def unb64(es): - if not isinstance(es, collections.ByteString): + if not isinstance(es, collections.abc.ByteString): try: es = es.encode("us-ascii") except UnicodeError: diff --git a/wrw/sp/cons.py b/wrw/sp/cons.py index d8b30a8..b9437bf 100644 --- a/wrw/sp/cons.py +++ b/wrw/sp/cons.py @@ -1,4 +1,4 @@ -import sys, collections +import sys, collections.abc import xml.dom.minidom class node(object): @@ -64,7 +64,7 @@ class context(object): new = self.nodefrom(child) if new is not None: node.children.append(new) - elif isinstance(child, collections.Iterable): + elif isinstance(child, collections.abc.Iterable): for ch in child: self.addchild(node, ch) else: -- 2.11.0