Skip to content

Commit

Permalink
updating code to python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanerobert committed Oct 31, 2024
1 parent dc290ae commit 4fa0603
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
8 changes: 4 additions & 4 deletions config_probe/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import os

import yaml
from munch import Munch, iteritems
from munch import Munch

from config_probe.exceptions import ConfigNotFound

Expand Down Expand Up @@ -46,7 +46,7 @@ def _deduce_namespaces(path_matchers, path_parts):
namespaces = []
path_parts, current_part = os.path.split(path_parts)
path_matchers, matcher = os.path.split(path_matchers)
while current_part is not "":
while current_part != "":
if matcher == NAMESPACE_PLACEHOLDER:
namespaces.append(current_part)

Expand All @@ -67,7 +67,7 @@ def _add_to_configuration(config, namespaces, new_values):

def _update(config, values):
for k, v in values.items():
if k in config and isinstance(v, collections.Mapping):
if k in config and isinstance(v, collections.abc.Mapping):
_update(config[k], v)
else:
config[k] = v
Expand All @@ -83,7 +83,7 @@ def __getattr__(self, k):

def _munchify(x):
if isinstance(x, dict):
return _Munch((k, _munchify(v)) for k,v in iteritems(x))
return _Munch((k, _munchify(v)) for k,v in x.items())
elif isinstance(x, (list, tuple)):
return type(x)(_munchify(v) for v in x)
else:
Expand Down
3 changes: 2 additions & 1 deletion test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
nose
pytest
pytest-cov
pyhamcrest
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
envlist = py27,py34
envlist = py34,p312

[testenv]
deps = -r{toxinidir}/test-requirements.txt
commands = nosetests
commands = pytest --cov --cov-report term-missing

0 comments on commit 4fa0603

Please sign in to comment.