Skip to content

Commit 9a65401

Browse files
committed
TEMP workaround: flyweight is not compatible with Python3
1 parent 1e82c2d commit 9a65401

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

flyweight.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ def __init__(self, *args, **kwargs):
7474

7575

7676
if __name__ == '__main__':
77+
import sys
78+
if sys.version_info[0] > 2:
79+
sys.stderr.write("!!! This example is compatible only with Python 2 ATM !!!\n")
80+
raise SystemExit(0)
81+
7782
# comment __new__ and uncomment __init__ to see the difference
7883
c1 = Card('9', 'h')
7984
c2 = Card('9', 'h')

0 commit comments

Comments
 (0)