Skip to content

Commit

Permalink
Removed warnings check
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Dec 9, 2015
1 parent 112240d commit 5f904ac
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 21 deletions.
13 changes: 6 additions & 7 deletions PIL/Image.py
Original file line number Diff line number Diff line change
Expand Up @@ -2103,13 +2103,12 @@ def frombuffer(mode, size, data, decoder_name="raw", *args):

if decoder_name == "raw":
if args == ():
if warnings:
warnings.warn(
"the frombuffer defaults may change in a future release; "
"for portability, change the call to read:\n"
" frombuffer(mode, size, data, 'raw', mode, 0, 1)",
RuntimeWarning, stacklevel=2
)
warnings.warn(
"the frombuffer defaults may change in a future release; "
"for portability, change the call to read:\n"
" frombuffer(mode, size, data, 'raw', mode, 0, 1)",
RuntimeWarning, stacklevel=2
)
args = mode, 0, -1 # may change to (mode, 0, 1) post-1.1.6
if args[0] in _MAPMODES:
im = new(mode, (1, 1))
Expand Down
12 changes: 3 additions & 9 deletions PIL/ImageDraw.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,11 @@
#

import numbers
import warnings

from PIL import Image, ImageColor
from PIL._util import isStringType

try:
import warnings
except ImportError:
warnings = None


##
# A simple 2D drawing interface for PIL images.
# <p>
Expand Down Expand Up @@ -99,9 +94,8 @@ def setfill(self, onoff):
"Please use keyword arguments instead.")

def setfont(self, font):
if warnings:
warnings.warn("setfont() is deprecated. " +
"Please set the attribute directly instead.")
warnings.warn("setfont() is deprecated. " +
"Please set the attribute directly instead.")
# compatibility
self.font = font

Expand Down
5 changes: 0 additions & 5 deletions PIL/ImageFont.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@
import os
import sys

try:
import warnings
except ImportError:
warnings = None


class _imagingft_not_installed(object):
# module placeholder
Expand Down

0 comments on commit 5f904ac

Please sign in to comment.