mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Python < 3.6 remainder cleanups (#25607)
This commit is contained in:
parent
671cb0d092
commit
3cf8964c06
10
.travis.yml
10
.travis.yml
@ -16,14 +16,14 @@ addons:
|
|||||||
matrix:
|
matrix:
|
||||||
fast_finish: true
|
fast_finish: true
|
||||||
include:
|
include:
|
||||||
- python: "3.5.3"
|
- python: "3.6"
|
||||||
env: TOXENV=lint
|
env: TOXENV=lint
|
||||||
- python: "3.5.3"
|
- python: "3.6"
|
||||||
env: TOXENV=pylint
|
env: TOXENV=pylint
|
||||||
- python: "3.5.3"
|
- python: "3.6"
|
||||||
env: TOXENV=typing
|
env: TOXENV=typing
|
||||||
- python: "3.5.3"
|
- python: "3.6"
|
||||||
env: TOXENV=py35
|
env: TOXENV=py36
|
||||||
- python: "3.7"
|
- python: "3.7"
|
||||||
env: TOXENV=py37
|
env: TOXENV=py37
|
||||||
|
|
||||||
|
@ -356,8 +356,7 @@ def main() -> int:
|
|||||||
|
|
||||||
monkey_patch_needed = sys.version_info[:3] < (3, 6, 3)
|
monkey_patch_needed = sys.version_info[:3] < (3, 6, 3)
|
||||||
if monkey_patch_needed and os.environ.get('HASS_NO_MONKEY') != '1':
|
if monkey_patch_needed and os.environ.get('HASS_NO_MONKEY') != '1':
|
||||||
if sys.version_info[:2] >= (3, 6):
|
monkey_patch.disable_c_asyncio()
|
||||||
monkey_patch.disable_c_asyncio()
|
|
||||||
monkey_patch.patch_weakref_tasks()
|
monkey_patch.patch_weakref_tasks()
|
||||||
|
|
||||||
set_loop()
|
set_loop()
|
||||||
|
@ -93,13 +93,6 @@ async def async_from_config_dict(config: Dict[str, Any],
|
|||||||
stop = time()
|
stop = time()
|
||||||
_LOGGER.info("Home Assistant initialized in %.2fs", stop-start)
|
_LOGGER.info("Home Assistant initialized in %.2fs", stop-start)
|
||||||
|
|
||||||
if sys.version_info[:3] < (3, 6, 0):
|
|
||||||
hass.components.persistent_notification.async_create(
|
|
||||||
"Python 3.5 support is deprecated and will "
|
|
||||||
"be removed in the first release after August 1. Please "
|
|
||||||
"upgrade Python.", "Python version", "python_version"
|
|
||||||
)
|
|
||||||
|
|
||||||
return hass
|
return hass
|
||||||
|
|
||||||
|
|
||||||
|
@ -12,7 +12,6 @@ import functools
|
|||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import pathlib
|
import pathlib
|
||||||
import sys
|
|
||||||
import threading
|
import threading
|
||||||
from time import monotonic
|
from time import monotonic
|
||||||
import uuid
|
import uuid
|
||||||
@ -142,9 +141,10 @@ class HomeAssistant:
|
|||||||
self.loop: asyncio.events.AbstractEventLoop = (
|
self.loop: asyncio.events.AbstractEventLoop = (
|
||||||
loop or asyncio.get_event_loop())
|
loop or asyncio.get_event_loop())
|
||||||
|
|
||||||
executor_opts = {'max_workers': None} # type: Dict[str, Any]
|
executor_opts = {
|
||||||
if sys.version_info[:2] >= (3, 6):
|
'max_workers': None,
|
||||||
executor_opts['thread_name_prefix'] = 'SyncWorker'
|
'thread_name_prefix': 'SyncWorker',
|
||||||
|
} # type: Dict[str, Any]
|
||||||
|
|
||||||
self.executor = ThreadPoolExecutor(**executor_opts)
|
self.executor = ThreadPoolExecutor(**executor_opts)
|
||||||
self.loop.set_default_executor(self.executor)
|
self.loop.set_default_executor(self.executor)
|
||||||
|
@ -11,7 +11,6 @@ classifier =
|
|||||||
Intended Audience :: Developers
|
Intended Audience :: Developers
|
||||||
License :: OSI Approved :: Apache Software License
|
License :: OSI Approved :: Apache Software License
|
||||||
Operating System :: OS Independent
|
Operating System :: OS Independent
|
||||||
Programming Language :: Python :: 3.5
|
|
||||||
Programming Language :: Python :: 3.6
|
Programming Language :: Python :: 3.6
|
||||||
Programming Language :: Python :: 3.7
|
Programming Language :: Python :: 3.7
|
||||||
Topic :: Home Automation
|
Topic :: Home Automation
|
||||||
|
Loading…
x
Reference in New Issue
Block a user