mirror of https://github.com/tLDP/python-tldp
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:
commit
0f70fd1aad
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue