Skip to content

Import ABC from collections.abc instead of collections for Python 3 compatibility #59

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/robotremoteserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

from __future__ import print_function

from collections import Mapping
import inspect
import os
import re
Expand All @@ -29,11 +28,13 @@
from SimpleXMLRPCServer import SimpleXMLRPCServer
from StringIO import StringIO
from xmlrpclib import Binary, ServerProxy
from collections import Mapping
PY2, PY3 = True, False
else:
from io import StringIO
from xmlrpc.client import Binary, ServerProxy
from xmlrpc.server import SimpleXMLRPCServer
from collections.abc import Mapping
PY2, PY3 = False, True
unicode = str
long = int
Expand Down
7 changes: 6 additions & 1 deletion test/libs/Returning.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
from collections import Mapping
import sys

if sys.version_info < (3,):
from collections import Mapping
else:
from collections.abc import Mapping


class Returning(object):
Expand Down