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
This commit is contained in:
Martin A. Brown 2022-10-23 15:33:28 -07:00 committed by GitHub
commit 0f70fd1aad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 5 deletions

View File

@ -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)

View File

@ -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.

View File

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