Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#33)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/asottile/setup-cfg-fmt: v1.20.0 → v1.20.1](asottile/setup-cfg-fmt@v1.20.0...v1.20.1)
- [github.com/asottile/reorder_python_imports: v2.7.1 → v3.0.1](asottile/reorder-python-imports@v2.7.1...v3.0.1)
- [github.com/asottile/pyupgrade: v2.31.0 → v2.31.1](asottile/pyupgrade@v2.31.0...v2.31.1)
- [github.com/psf/black: 22.1.0 → 22.3.0](psf/black@22.1.0...22.3.0)
- [github.com/pre-commit/mirrors-mypy: v0.931 → v0.942](pre-commit/mirrors-mypy@v0.931...v0.942)

* Updated _get_local_file_metadata() method to use system-specific check rather than try block to pass mypy attribute checking.

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Dario Bauer <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and dariobauer authored Apr 9, 2022
1 parent 586e9e5 commit b01f153
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@ ci:
autoupdate_schedule: monthly
repos:
- repo: https://github.com/asottile/setup-cfg-fmt
rev: v1.20.0
rev: v1.20.1
hooks:
- id: setup-cfg-fmt
- repo: https://github.com/asottile/reorder_python_imports
rev: v2.7.1
rev: v3.0.1
hooks:
- id: reorder-python-imports
name: Reorder Python imports (src, tests)
args: ["--application-directories", "src"]
- repo: https://github.com/asottile/pyupgrade
rev: v2.31.0
rev: v2.31.1
hooks:
- id: pyupgrade
args: ["--py37-plus"]
- repo: https://github.com/psf/black
rev: 22.1.0
rev: 22.3.0
hooks:
- id: black
# Latest version of Python supported by the project
Expand Down Expand Up @@ -49,7 +49,7 @@ repos:
- id: fix-byte-order-marker
- id: end-of-file-fixer
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.931
rev: v0.942
hooks:
- id: mypy
additional_dependencies: [types-aiofiles, types-PyYAML, types-toml]
10 changes: 5 additions & 5 deletions src/graph_onedrive/_onedrive.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import re
import secrets
import shutil
import sys
import tempfile
import urllib.parse
import warnings
Expand Down Expand Up @@ -1461,16 +1462,15 @@ def _get_local_file_metadata(self, file_path: str | Path) -> tuple[int, str, str
# Get the file modified time
file_modified = os.path.getmtime(file_path)
# Get the file creation time (platform specific)
if os.name == "nt":
if sys.platform == "win32":
# Windows OS
file_created = os.path.getctime(file_path)
else:
# Other OS
stat = os.stat(file_path)
try:
# Likely Mac OS
if sys.platform == "darwin":
# Mac OS
file_created = stat.st_birthtime
except AttributeError:
else:
# Likely Linux OS, fall back to last modified.
file_created = stat.st_mtime
# Convert the seconds to UTC ISO timestamps
Expand Down

0 comments on commit b01f153

Please sign in to comment.