Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relax type checking of path arguments, part 2. #35

Closed
wants to merge 1 commit into from
Closed

Relax type checking of path arguments, part 2. #35

wants to merge 1 commit into from

Conversation

tanzer
Copy link
Contributor

@tanzer tanzer commented Oct 8, 2012

Fix more type checks of the form isinstance(cmd, str):

  • Replace some of them with checks like::

    not isinstance(cmd, RemotePath)

  • Replace others by checking against basestring instead of str.

Unfortunately, back in May, I didn't grep for other occurrences of these
checks. When testing version 1.0 of plumbum, I promptly got::

Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "plumbum/local_machine.py", line 531, in __getitem__
    raise TypeError("cmd must be a LocalPath or a string: %r" % (cmd,))
TypeError: cmd must be a LocalPath or a string: u'dir'

Hoping that I fixed everything this time around :-).

Tomer, I'm sorry about reporting this just after 1.0, but could you possibly do a 1.0.1 to fix the remaining type checks?

Fix more type checks of the form `isinstance(cmd, str)`:

- Replace some of them with checks like::

    `not isinstance(cmd, RemotePath)`

- Replace others by checking against `basestring` instead of `str`.
@ghost ghost assigned tomerfiliba Oct 8, 2012
@tomerfiliba
Copy link
Owner

thanks @tanzer !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants