Removed the still existing six dependency of the asttokens package.

Tue, 09 Apr 2019 19:14:11 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 09 Apr 2019 19:14:11 +0200
changeset 6936
6b301c8a3c5b
parent 6935
71627b93aebc
child 6937
25317a7b5d40

Removed the still existing six dependency of the asttokens package.

ThirdParty/asttokens/asttokens/util.py file | annotate | diff | comparison | revisions
--- a/ThirdParty/asttokens/asttokens/util.py	Tue Apr 09 19:13:26 2019 +0200
+++ b/ThirdParty/asttokens/asttokens/util.py	Tue Apr 09 19:14:11 2019 +0200
@@ -12,10 +12,20 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+import sys
+# define some compatibility methods like it is done in six.
+if sys.version_info[0] == 2:
+    # Python 2
+    def iteritems(d):
+        return d.iteritems()
+else:
+    # Python 3
+    def iteritems(d):
+        return iter(d.items())
+
 import ast
 import collections
 import token
-from six import iteritems
 
 
 def token_repr(tok_type, string):

eric ide

mercurial