Rename buffer -> bytearray.
diff --git a/Lib/encodings/idna.py b/Lib/encodings/idna.py
index 30f507a..c2ba1da 100644
--- a/Lib/encodings/idna.py
+++ b/Lib/encodings/idna.py
@@ -153,7 +153,7 @@
         if not input:
             return b'', 0
 
-        result = buffer()
+        result = bytearray()
         labels = dots.split(input)
         if labels and not labels[-1]:
             trailing_dot = b'.'
@@ -216,7 +216,7 @@
                 if labels:
                     trailing_dot = b'.'
 
-        result = buffer()
+        result = bytearray()
         size = 0
         for label in labels:
             if size:
diff --git a/Lib/encodings/punycode.py b/Lib/encodings/punycode.py
index 56e6958..b801a46 100644
--- a/Lib/encodings/punycode.py
+++ b/Lib/encodings/punycode.py
@@ -10,7 +10,7 @@
 
 def segregate(str):
     """3.1 Basic code point segregation"""
-    base = buffer()
+    base = bytearray()
     extended = set()
     for c in str:
         if ord(c) < 128:
@@ -78,7 +78,7 @@
 digits = b"abcdefghijklmnopqrstuvwxyz0123456789"
 def generate_generalized_integer(N, bias):
     """3.3 Generalized variable-length integers"""
-    result = buffer()
+    result = bytearray()
     j = 0
     while 1:
         t = T(j, bias)
@@ -107,7 +107,7 @@
 def generate_integers(baselen, deltas):
     """3.4 Bias adaptation"""
     # Punycode parameters: initial bias = 72, damp = 700, skew = 38
-    result = buffer()
+    result = bytearray()
     bias = 72
     for points, delta in enumerate(deltas):
         s = generate_generalized_integer(delta, bias)