Skip to content

Commit e625c74

Browse files
committed
Import ABC from collections.abc instead of collections for Python 3 compatibility.
1 parent 5324821 commit e625c74

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/robotremoteserver.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
from __future__ import print_function
1717

18-
from collections import Mapping
1918
import inspect
2019
import os
2120
import re
@@ -29,11 +28,13 @@
2928
from SimpleXMLRPCServer import SimpleXMLRPCServer
3029
from StringIO import StringIO
3130
from xmlrpclib import Binary, ServerProxy
31+
from collections import Mapping
3232
PY2, PY3 = True, False
3333
else:
3434
from io import StringIO
3535
from xmlrpc.client import Binary, ServerProxy
3636
from xmlrpc.server import SimpleXMLRPCServer
37+
from collections.abc import Mapping
3738
PY2, PY3 = False, True
3839
unicode = str
3940
long = int

test/libs/Returning.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
from collections import Mapping
1+
import sys
2+
3+
if sys.version_info < (3,):
4+
from collections import Mapping
5+
else:
6+
from collections.abc import Mapping
27

38

49
class Returning(object):

0 commit comments

Comments
 (0)