Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Consolidate various Python 2/3 compatibility tests in pyrseas.lib.pyc…
…ompat. pyrseas/lib/pycompat.py: Defines PY2 and strtypes. PY2 is used to normalize various tests for Python 2.x. strtypes is moved from pyrseas/dbobject/function.py so that it can be used elsewhere. Note: This breaks the autodoc and pagila functional tests under Python 2.x, due to use of yaml.safe_dump in change 1e4fa91.
- Loading branch information
Showing
7 changed files
with
34 additions
and
18 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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
pyrseas.lib.pycompat | ||
~~~~~~~~~~~~~~~~~~~~ | ||
Helpers for compatibility between Python 2.x and 3.x. | ||
""" | ||
import sys | ||
|
||
PY2 = sys.version_info[0] == 2 | ||
|
||
if not PY2: | ||
strtypes = (str, ) | ||
else: | ||
strtypes = (str, unicode) |
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
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