Dictionaries are ordered by insert by default on Python 3.6. (#8678)

This commit is contained in:
Mads Jensen
2021-02-25 15:41:05 -08:00
committed by GitHub
parent b0e35c694e
commit 540fd6db93
2 changed files with 3 additions and 4 deletions
+1 -2
View File
@@ -1,5 +1,4 @@
"""Utilities for plugins discovery and selection."""
import collections
import itertools
import logging
import sys
@@ -209,7 +208,7 @@ class PluginsRegistry(Mapping):
# This prevents deadlock caused by plugins acquiring a lock
# and ensures at least one concurrent Certbot instance will run
# successfully.
self._plugins = collections.OrderedDict(sorted(plugins.items()))
self._plugins = dict(sorted(plugins.items()))
@classmethod
def find_all(cls):
+2 -2
View File
@@ -4,7 +4,6 @@
import argparse
import atexit
import collections
from collections import OrderedDict
import distutils.version
import errno
import logging
@@ -16,6 +15,7 @@ import sys
import configargparse
from acme.magic_typing import Dict
from acme.magic_typing import Text
from acme.magic_typing import Tuple
from acme.magic_typing import Union
@@ -58,7 +58,7 @@ _INITIAL_PID = os.getpid()
# the dict are attempted to be cleaned up at program exit. If the
# program exits before the lock is cleaned up, it is automatically
# released, but the file isn't deleted.
_LOCKS = OrderedDict() # type: OrderedDict[str, lock.LockFile]
_LOCKS = {} # type: Dict[str, lock.LockFile]
def env_no_snap_for_external_calls():