Skip to content

Commit

Permalink
Bug Fix: import from collections
Browse files Browse the repository at this point in the history
The util decorators failed to import from collections.abc for
Py3 instead of collections (from Py2).
  • Loading branch information
BenjamenMeyer committed Jan 31, 2024
1 parent 15586e6 commit bf25972
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 7 deletions.
1 change: 0 additions & 1 deletion stackinabox/util/httpretty/decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
try:
import collections.abc as collections
except ImportError:
# Py2.7 Support
import collections
import functools
import logging
Expand Down
1 change: 0 additions & 1 deletion stackinabox/util/requests_mock/decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
try:
import collections.abc as collections
except ImportError:
# Py2.7 Support
import collections
import functools
import logging
Expand Down
3 changes: 2 additions & 1 deletion stackinabox/util/responses/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ def registration(uri):
for method in METHODS:
responses.add_callback(method,
regex,
callback=responses_callback)
callback=responses_callback,
content_type=None)


@deprecator.DeprecatedInterface("responses_registration", "registration")
Expand Down
1 change: 0 additions & 1 deletion stackinabox/util/responses/decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
try:
import collections.abc as collections
except ImportError:
# Py2.7 Support
import collections

import functools
Expand Down
5 changes: 4 additions & 1 deletion tests/util/httpretty/test_decorator.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
"""
Stack-In-A-Box: Basic Test
"""
import collections
try:
import collections.abc as collections
except ImportError:
import collections
import sys
import types
import unittest
Expand Down
5 changes: 4 additions & 1 deletion tests/util/requests_mock/test_decorator.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
"""
Stack-In-A-Box: Basic Test
"""
import collections
try:
import collections.abc as collections
except ImportError:
import collections
import json
import logging
import types
Expand Down
6 changes: 5 additions & 1 deletion tests/util/response/test_decorator.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
"""
Stack-In-A-Box: Basic Test
"""
import collections
try:
import collections.abc as collections
except ImportError:
import collections

import json
import logging
import types
Expand Down

0 comments on commit bf25972

Please sign in to comment.