Bug #77779 | Example for version check for CAPI doesn't work | ||
---|---|---|---|
Submitted: | 19 Jul 2015 8:16 | Modified: | 24 Jul 2015 12:52 |
Reporter: | Daniël van Eeden (OCA) | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | Connector / Python Documentation | Severity: | S3 (Non-critical) |
Version: | 2.0.4, 2.1.2b1 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[19 Jul 2015 8:16]
Daniël van Eeden
[20 Jul 2015 6:00]
MySQL Verification Team
Hello Daniël, Thank you for the report. Thanks, Umesh
[20 Jul 2015 6:01]
MySQL Verification Team
// [root@cluster-repo ~]# python Python 2.6.6 (r266:84292, Jan 22 2014, 01:49:05) [GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> >>> import mysql.connector >>> mysql.connector.VERSION > (2, 1) Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'module' object has no attribute 'VERSION' >>> mysql.connector.__version_info__ > (2, 1) True >>> mysql.connector.__version__ '2.1.2b1' >>>
[24 Jul 2015 12:52]
Paul DuBois
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly. Should be __version_info__, not VERSION: if mysql.connector.__version_info__ > (2, 1) and mysql.connector.HAVE_CEXT: config['use_pure'] = False VERSION can be used if you import mysql.connector.version, but let's keep the example simpler.