~ubuntu-branches/ubuntu/wily/python-imaging/wily

« back to all changes in this revision

Viewing changes to PIL/GdImageFile.py

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2013-01-31 20:49:20 UTC
  • mfrom: (27.1.1 raring-proposed)
  • Revision ID: package-import@ubuntu.com-20130131204920-b5zshy6vgfvdionl
Tags: 1.1.7+1.7.8-1ubuntu1
Rewrite build dependencies to allow cross builds.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 
26
26
__version__ = "0.1"
27
27
 
28
 
import ImageFile, ImagePalette
29
 
 
30
 
def i16(c):
31
 
    return ord(c[1]) + (ord(c[0])<<8)
 
28
from . import ImageFile, ImagePalette, _binary
 
29
 
 
30
try:
 
31
    import builtins
 
32
except ImportError:
 
33
    import __builtin__
 
34
    builtins = __builtin__
 
35
 
 
36
i16 = _binary.i16be
32
37
 
33
38
##
34
39
# Image plugin for the GD uncompressed format.  Note that this format
72
77
    if mode != "r":
73
78
        raise ValueError("bad mode")
74
79
 
75
 
    if type(fp) == type(""):
76
 
        import __builtin__
 
80
    if isinstance(fp, str):
77
81
        filename = fp
78
 
        fp = __builtin__.open(fp, "rb")
 
82
        fp = builtins.open(fp, "rb")
79
83
    else:
80
84
        filename = ""
81
85