-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2284 from infosiftr/python-gbdm
Reorder python import test to use gnu dbm imports instead of generic dbm
- Loading branch information
Showing
1 changed file
with
13 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,23 @@ | ||
import curses | ||
import dbm | ||
import readline | ||
|
||
import bz2 | ||
assert(bz2.decompress(bz2.compress(b'IT WORKS IT WORKS IT WORKS')) == b'IT WORKS IT WORKS IT WORKS') | ||
|
||
import platform | ||
if platform.python_implementation() != 'PyPy' and platform.python_version_tuple()[0] != '2': | ||
# PyPy and Python 2 don't support lzma | ||
import lzma | ||
assert(lzma.decompress(lzma.compress(b'IT WORKS IT WORKS IT WORKS')) == b'IT WORKS IT WORKS IT WORKS') | ||
|
||
isNotPypy = platform.python_implementation() != 'PyPy' | ||
isCaveman = platform.python_version_tuple()[0] == '2' | ||
|
||
if isCaveman: | ||
import gdbm | ||
else: | ||
import dbm.gnu | ||
|
||
if isNotPypy: | ||
# PyPy and Python 2 don't support lzma | ||
import lzma | ||
assert(lzma.decompress(lzma.compress(b'IT WORKS IT WORKS IT WORKS')) == b'IT WORKS IT WORKS IT WORKS') | ||
|
||
import zlib | ||
assert(zlib.decompress(zlib.compress(b'IT WORKS IT WORKS IT WORKS')) == b'IT WORKS IT WORKS IT WORKS') |