Skip to content

Commit

Permalink
Fix issue with type checking in glob (#211)
Browse files Browse the repository at this point in the history
* Fix issue with type checking in glob

* Update changelog
  • Loading branch information
facelessuser committed Feb 20, 2024
1 parent 876362e commit 6d105d1
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 4 deletions.
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018 - 2023 Isaac Muse
Copyright (c) 2018 - 2024 Isaac Muse

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 4 additions & 0 deletions docs/src/markdown/about/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 8.5.1

- **FIX**: Fix issue with type check failure in `wcmatch.glob`.

## 8.5

- **NEW**: Formally support Python 3.11 (no change).
Expand Down
31 changes: 30 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ repo_url: https://github.com/facelessuser/wcmatch
edit_uri: tree/main/docs/src/markdown
site_description: A wildcard file name matching library
copyright: |
Copyright &copy; 2014 - 2023 <a href="https://github.com/facelessuser" target="_blank" rel="noopener">Isaac Muse</a>
Copyright &copy; 2014 - 2024 <a href="https://github.com/facelessuser" target="_blank" rel="noopener">Isaac Muse</a>
docs_dir: docs/src/markdown
theme:
Expand Down Expand Up @@ -120,6 +120,35 @@ markdown_extensions:
- example
- quote
- pymdownx.blocks.details:
types:
- name: details-new
class: new
- name: details-settings
class: settings
- name: details-note
class: note
- name: details-abstract
class: abstract
- name: details-info
class: info
- name: details-tip
class: tip
- name: details-success
class: success
- name: details-question
class: question
- name: details-warning
class: warning
- name: details-failure
class: failure
- name: details-danger
class: danger
- name: details-bug
class: bug
- name: details-example
class: example
- name: details-quote
class: quote
- pymdownx.blocks.html:
- pymdownx.blocks.definition:
- pymdownx.blocks.tab:
Expand Down
2 changes: 1 addition & 1 deletion wcmatch/__meta__.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,5 +194,5 @@ def parse_version(ver: str) -> Version:
return Version(major, minor, micro, release, pre, post, dev)


__version_info__ = Version(8, 5, 0, "final")
__version_info__ = Version(8, 5, 1, "final")
__version__ = __version_info__._get_canonical()
2 changes: 1 addition & 1 deletion wcmatch/glob.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ def __init__(
self.re_no_dir = cast(Pattern[AnyStr], _wcparse.RE_WIN_NO_DIR[ptype])

temp = os.fspath(root_dir) if root_dir is not None else self.current
if not isinstance(temp, type(pats[0])):
if not isinstance(temp, bytes if ptype else str):
raise TypeError(
'Pattern and root_dir should be of the same type, not {} and {}'.format(
type(pats[0]), type(temp)
Expand Down

0 comments on commit 6d105d1

Please sign in to comment.