Commits

Mikhail Korobov  committed 7cf55bc

fix some syntax errors, partially restore python 3.x compatibility (tests still fail)

  • Participants
  • Parent commits aaad8c7

Comments (0)

Files changed (2)

File src/psd_tools/decoder/actions.py

 
     items = []
     item_count = read_fmt("I", fp)[0]
-    for n in xrange(item_count):
+    for n in range(item_count):
         item_length = read_fmt("I", fp)[0]
         key = fp.read(item_length or 4)
         ostype = fp.read(4)
 def decode_ref(key, fp):
     item_count = read_fmt("I", fp)[0]
     items = []
-    for _ in xrange(item_count):
+    for _ in range(item_count):
         ostype = read_fmt("I", fp)
 
         decode_ostype = {
 def decode_unit_float(key, fp):
     unit_key = read_fmt("I", fp)
     unit = {
-        '#Ang', 'angle',
-        '#Rsl', 'density',
-        '#Rlt', 'distance',
-        '#Nne', 'none',
-        '#Prc', 'percent',
-        '#Pxl', 'pixels',
+        '#Ang': 'angle',
+        '#Rsl': 'density',
+        '#Rlt': 'distance',
+        '#Nne': 'none',
+        '#Prc': 'percent',
+        '#Pxl': 'pixels',
     }.get(unit_key, None)
     if unit:
         value = read_fmt("d", fp)
 def decode_list(key, fp):
     items_count = read_fmt("I", fp)[0]
     items = []
-    for _ in xrange(items_count):
+    for _ in range(items_count):
         ostype = read_fmt("I", fp)
 
         decode_ostype = get_ostype(ostype)
 ; under different Python interpreters
 
 [tox]
-envlist = py26,py27,py32,pypy
+envlist = py26,py27,py32,pypy,py33
 
 [base]
 deps=
 [testenv:py32]
 deps=
     {[base]deps}
-    git+https://github.com/fluggo/Pillow.git@4903496301d1a2a0cfdc0aa7fb10c4023e75d8af#egg=Pillow
+    git+https://github.com/python-imaging/Pillow.git@e09ff61b81ff23baf635eeb98b788ad0a51cc86f#egg=Pillow
 
 [testenv:py33]
 deps=
     {[base]deps}
-    git+https://github.com/fluggo/Pillow.git@4903496301d1a2a0cfdc0aa7fb10c4023e75d8af#egg=Pillow
+    git+https://github.com/python-imaging/Pillow.git@e09ff61b81ff23baf635eeb98b788ad0a51cc86f#egg=Pillow