Merge pull request #10 from martin-a-brown/mabrown/support-python-3.10-and-ubuntu-22.04

support Python3.8+: fix import for MutableMapping and other minor fixes
master
Martin A. Brown 7 months ago committed by GitHub
commit 0f70fd1aad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      tldp/config.py
  2. 9
      tldp/ldpcollection.py
  3. 2
      tox.ini

@ -8,7 +8,6 @@ from __future__ import unicode_literals
import os
import argparse
import copy as _copy
import logging
@ -30,7 +29,7 @@ class DirectoriesExist(argparse._AppendAction):
message = message % (values, option_string)
logger.critical(message)
raise ValueError(message)
items = _copy.copy(argparse._ensure_value(namespace, self.dest, []))
items = getattr(namespace, self.dest, [])
items.append(values)
setattr(namespace, self.dest, items)

@ -5,10 +5,15 @@
from __future__ import absolute_import, division, print_function
import collections
import sys
if sys.version_info[:2] >= (3, 8): # pragma: no cover
from collections.abc import MutableMapping
else: # pragma: no cover
from collections import MutableMapping
class LDPDocumentCollection(collections.MutableMapping):
class LDPDocumentCollection(MutableMapping):
'''a dict-like container for DocumentCollection objects
Intended to be subclassed.

@ -4,7 +4,7 @@
# and then run "tox" from this directory.
[tox]
envlist = py27, py34, py35
envlist = py39, py310
skip_missing_interpreters = True
[testenv]

Loading…
Cancel
Save