mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
Remove unused imports & clean up sys imports in test_struct.
This commit is contained in:
parent
65d7643cb4
commit
79d38ac706
1 changed files with 3 additions and 7 deletions
|
@ -1,15 +1,12 @@
|
||||||
import array
|
import array
|
||||||
import unittest
|
import unittest
|
||||||
import struct
|
import struct
|
||||||
import warnings
|
|
||||||
|
|
||||||
from functools import wraps
|
|
||||||
from test.support import TestFailed, verbose, run_unittest
|
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
from test.support import run_unittest
|
||||||
|
|
||||||
ISBIGENDIAN = sys.byteorder == "big"
|
ISBIGENDIAN = sys.byteorder == "big"
|
||||||
IS32BIT = sys.maxsize == 0x7fffffff
|
IS32BIT = sys.maxsize == 0x7fffffff
|
||||||
del sys
|
|
||||||
|
|
||||||
def string_reverse(s):
|
def string_reverse(s):
|
||||||
return s[::-1]
|
return s[::-1]
|
||||||
|
@ -377,7 +374,6 @@ class StructTest(unittest.TestCase):
|
||||||
def test_1229380(self):
|
def test_1229380(self):
|
||||||
# SF bug 1229380. No struct.pack exception for some out of
|
# SF bug 1229380. No struct.pack exception for some out of
|
||||||
# range integers
|
# range integers
|
||||||
import sys
|
|
||||||
for endian in ('', '>', '<'):
|
for endian in ('', '>', '<'):
|
||||||
for fmt in ('B', 'H', 'I', 'L'):
|
for fmt in ('B', 'H', 'I', 'L'):
|
||||||
self.assertRaises((struct.error, OverflowError), struct.pack,
|
self.assertRaises((struct.error, OverflowError), struct.pack,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue