()
| 889 | update_available = False |
| 890 | update_version = 0 |
| 891 | def update_check(): |
| 892 | global update_available |
| 893 | global update_version |
| 894 | socket.setdefaulttimeout(TIMEOUT_SILENT) |
| 895 | if sys.version_info >= (3,0): |
| 896 | req = urllib.request.Request(WEB_VERSION_CHECK) |
| 897 | else: |
| 898 | req = urllib.Request(WEB_VERSION_CHECK) |
| 899 | try: |
| 900 | response = urllib.urlopen(req) |
| 901 | version = response.readline().strip() |
| 902 | except Exception as e: |
| 903 | debug_msg(e) |
| 904 | return |
| 905 | if version > VERSION: # simply comparing strings works just fine |
| 906 | update_available = True |
| 907 | update_version = version |
| 908 | |
| 909 | if cfg.VERSION_CHECK_ON_STARTUP and not CLINICAL_MODE: |
| 910 | update_check() |
no test coverage detected