Skip to content

Commit

Permalink
Fix deprecated typing (#1694)
Browse files Browse the repository at this point in the history
  • Loading branch information
vkbo authored Feb 13, 2024
2 parents fb92c6c + 16d2f1c commit 17aae16
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/syntax.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Checkout Source
uses: actions/checkout@v4
- name: Install flake8
run: pip install flake8
run: pip install flake8 flake8-pep585
- name: Syntax Check
run: |
flake8 --version
Expand Down
2 changes: 1 addition & 1 deletion novelwriter/core/buildsettings.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
import logging

from enum import Enum
from typing import Iterable
from pathlib import Path
from collections.abc import Iterable

from PyQt5.QtCore import QT_TRANSLATE_NOOP, QCoreApplication

Expand Down
2 changes: 1 addition & 1 deletion novelwriter/core/coretools.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
import shutil
import logging

from typing import Iterable
from pathlib import Path
from functools import partial
from zipfile import ZipFile, is_zipfile
from collections.abc import Iterable

from PyQt5.QtCore import QCoreApplication

Expand Down
2 changes: 1 addition & 1 deletion novelwriter/core/docbuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@

import logging

from typing import Iterable
from pathlib import Path
from collections.abc import Iterable

from PyQt5.QtGui import QFont, QFontInfo

Expand Down
3 changes: 2 additions & 1 deletion novelwriter/core/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@
import logging

from time import time
from typing import TYPE_CHECKING, ItemsView, Iterable, Iterator
from typing import TYPE_CHECKING
from pathlib import Path
from collections.abc import ItemsView, Iterable, Iterator

from novelwriter import SHARED
from novelwriter.enum import nwComment, nwItemClass, nwItemType, nwItemLayout
Expand Down
3 changes: 2 additions & 1 deletion novelwriter/core/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@

from enum import Enum
from time import time
from typing import TYPE_CHECKING, Iterator
from typing import TYPE_CHECKING
from pathlib import Path
from functools import partial
from collections.abc import Iterator

from PyQt5.QtCore import QCoreApplication

Expand Down
3 changes: 2 additions & 1 deletion novelwriter/core/sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@
import logging

from time import time
from typing import TYPE_CHECKING, Iterator
from typing import TYPE_CHECKING
from pathlib import Path
from collections.abc import Iterator

from novelwriter.error import logException
from novelwriter.common import formatTimeStamp
Expand Down
3 changes: 2 additions & 1 deletion novelwriter/core/spellcheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@
import json
import logging

from typing import TYPE_CHECKING, Iterator
from typing import TYPE_CHECKING
from pathlib import Path
from collections.abc import Iterator

from PyQt5.QtCore import QLocale

Expand Down
3 changes: 2 additions & 1 deletion novelwriter/core/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
import random
import logging

from typing import TYPE_CHECKING, ItemsView, Iterator, KeysView, Literal, ValuesView
from typing import TYPE_CHECKING, Literal
from collections.abc import ItemsView, Iterator, KeysView, ValuesView

from PyQt5.QtGui import QIcon, QPainter, QPainterPath, QPixmap, QColor
from PyQt5.QtCore import QRectF, Qt
Expand Down
2 changes: 1 addition & 1 deletion novelwriter/core/toodt.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
import logging
import xml.etree.ElementTree as ET

from typing import Sequence
from hashlib import sha256
from pathlib import Path
from zipfile import ZipFile
from datetime import datetime
from collections.abc import Sequence

from novelwriter import __version__
from novelwriter.common import xmlIndent
Expand Down
3 changes: 2 additions & 1 deletion novelwriter/core/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@
import random
import logging

from typing import TYPE_CHECKING, Iterator, Literal, overload
from typing import TYPE_CHECKING, Literal, overload
from pathlib import Path
from collections.abc import Iterator

from novelwriter.enum import nwItemClass, nwItemLayout, nwItemType
from novelwriter.error import logException
Expand Down

0 comments on commit 17aae16

Please sign in to comment.