diff --git a/qrencode/__init__.py b/qrencode/__init__.py
index <HASH>..<HASH> 100644
--- a/qrencode/__init__.py
+++ b/qrencode/__init__.py
@@ -48,7 +48,7 @@ def encode(data, version=0, level=QR_ECLEVEL_L, hint=QR_MODE_8,
     else:
         version, size, data = _encode(data, version, level, hint, False)
     
-    im = Image.fromstring('L', (size, size), data)
+    im = Image.frombytes('L', (size, size), data)
     return (version, size, im)
 
 def encode_scaled(data, size, version=0, level=QR_ECLEVEL_L, hint=QR_MODE_8,
Call `frombytes` instead of `fromstring`

Image.fromstring() was removed in Pillow in version 3, see
<URL>