8000 Python3 support by wardal · Pull Request #2 · ask/flakeplus · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Python3 support #2

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension 8000

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions flakeplus/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,15 +190,24 @@ def die(self, msg):
return EX_USAGE

def expanduser(self, value):
if isinstance(value, basestring):
return os.path.expanduser(value)
try:
if isinstance(value, basestring):
return os.path.expanduser(value)
except NameError:
if isinstance(value, str):
return os.path.expanduser(value)
return value

def handle_argv(self, prog_name, argv):
options, args = self.parse_options(prog_name, argv)
options = dict((k, self.expanduser(v))
for k, v in vars(options).iteritems()
if not k.startswith('_'))
try:
options = dict((k, self.expanduser(v))
for k, v in vars(options).iteritems()
if not k.startswith('_'))
except AttributeError:
options = dict((k, self.expanduser(v))
for k, v in vars(options).items()
if not k.startswith('_'))
argv = map(self.expanduser, argv)
if not argv:
return self.die('No input files/directories')
Expand Down
0