File tree Expand file tree Collapse file tree 4 files changed +10
-1
lines changed Expand file tree Collapse file tree 4 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -496,6 +496,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
496496* Added ` kwargs ` to all child classes of ` compas.data.Data ` .
497497* Added grasshopper component for drawing a frame.
498498* Added ` draw_origin ` and ` draw_axes ` .
499+ * Added ` compas.PY2 ` .
499500
500501### Changed
501502
Original file line number Diff line number Diff line change 7676Float formatting (``'<x>f'``) and integer formatting (``'d'``) specifiers are supported.
7777"""
7878
79+ PY2 = compas ._os .PY2
80+ """bool: True if the current Python version is 2.x, False otherwise."""
81+
7982PY3 = compas ._os .PY3
8083"""bool: True if the current Python version is 3.x, False otherwise."""
8184
Original file line number Diff line number Diff line change 1717 class NotADirectoryError (Exception ):
1818 pass
1919
20+ PY2 = sys .version_info [0 ] == 2
2021PY3 = sys .version_info [0 ] == 3
2122SYMLINK_REGEX = re .compile (r"\n.*\<SYMLINKD\>\s(.*)\s\[(.*)\]\r" )
2223
Original file line number Diff line number Diff line change 1+ import compas
12from collections import defaultdict
2- from collections import Mapping
3+ if compas .PY2 :
4+ from collections import Mapping
5+ else :
6+ from collections .abc import Mapping
37from compas .colors import Color
48
59
You can’t perform that action at this time.
0 commit comments