From 590d3bf1df4bf5ef8d8297dc7a189b4a9f08e747 Mon Sep 17 00:00:00 2001 From: Paul Tagliamonte Date: Wed, 1 Jan 2014 22:30:09 -0500 Subject: [PATCH] Clean up compare to use the tuple. Thanks @olasd --- hy/_compat.py | 2 +- hy/compiler.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hy/_compat.py b/hy/_compat.py index 65aa29b..e25f9cd 100644 --- a/hy/_compat.py +++ b/hy/_compat.py @@ -39,7 +39,7 @@ except ImportError: import sys PY3 = sys.version_info[0] >= 3 -PY33 = sys.version_info[0] >= 3 and sys.version_info[1] >= 3 +PY33 = sys.version_info >= (3, 3) if PY3: str_type = str diff --git a/hy/compiler.py b/hy/compiler.py index 0a7071c..dbb3ee5 100644 --- a/hy/compiler.py +++ b/hy/compiler.py @@ -754,7 +754,7 @@ class HyASTCompiler(object): ret = handler_results - if sys.version_info[0] >= 3 and sys.version_info[1] >= 3: + if sys.version_info >= (3, 3): # Python 3.3 features a merge of TryExcept+TryFinally into Try. return ret + ast.Try( lineno=expr.start_line, @@ -1199,7 +1199,7 @@ class HyASTCompiler(object): optional_vars=thing, body=body.stmts) - if sys.version_info[0] >= 3 and sys.version_info[1] >= 3: + if sys.version_info >= (3, 3): the_with.items = [ast.withitem(context_expr=ctx.force_expr, optional_vars=thing)] @@ -1699,7 +1699,7 @@ class HyASTCompiler(object): arglist = expression.pop(0) ret, args, defaults, stararg, kwargs = self._parse_lambda_list(arglist) - if sys.version_info[0] >= 3 and sys.version_info[1] >= 4: + if sys.version_info >= (3, 4): # Python 3.4+ requres that args are an ast.arg object, rather # than an ast.Name or bare string. args = [ast.arg(arg=ast_str(x),