- Issue #5463: In struct module, remove deprecated overflow wrapping
  when packing an integer: for example, struct.pack('=L', -1) now
  raises struct.error instead of returning b'\xff\xff\xff\xff'.

  Thanks Andreas Schawo for the patch.
diff --git a/Lib/test/test_struct.py b/Lib/test/test_struct.py
index 3d5e028..1d10b8f 100644
--- a/Lib/test/test_struct.py
+++ b/Lib/test/test_struct.py
@@ -2,8 +2,6 @@
 import unittest
 import struct
 import warnings
-warnings.filterwarnings("ignore", "struct integer overflow masking is deprecated",
-                        DeprecationWarning)
 
 from functools import wraps
 from test.support import TestFailed, verbose, run_unittest
@@ -17,11 +15,9 @@
     import _struct
 except ImportError:
     PY_STRUCT_RANGE_CHECKING = 0
-    PY_STRUCT_OVERFLOW_MASKING = 1
     PY_STRUCT_FLOAT_COERCE = 2
 else:
     PY_STRUCT_RANGE_CHECKING = getattr(_struct, '_PY_STRUCT_RANGE_CHECKING', 0)
-    PY_STRUCT_OVERFLOW_MASKING = getattr(_struct, '_PY_STRUCT_OVERFLOW_MASKING', 0)
     PY_STRUCT_FLOAT_COERCE = getattr(_struct, '_PY_STRUCT_FLOAT_COERCE', 0)
 
 def string_reverse(s):
@@ -51,8 +47,7 @@
     except (struct.error, OverflowError):
         pass
     except DeprecationWarning:
-        if not PY_STRUCT_OVERFLOW_MASKING:
-            raise TestFailed("%s%s expected to raise DeprecationWarning" % (
+        raise TestFailed("%s%s expected to raise DeprecationWarning" % (
                 func.__name__, args))
     else:
         raise TestFailed("%s%s did not raise error" % (
@@ -471,11 +466,6 @@
                 self.check_float_coerce(endian + fmt, 1.0)
                 self.check_float_coerce(endian + fmt, 1.5)
 
-    def test_issue4228(self):
-        # Packing a long may yield either 32 or 64 bits
-        x = struct.pack('L', -1)[:4]
-        self.assertEqual(x, b'\xff'*4)
-
     def test_unpack_from(self):
         test_string = b'abcd01234'
         fmt = '4s'