Skip to content

Commit

Permalink
Fix in_r2() regression (release 1.9.4 r2pipe.py)
Browse files Browse the repository at this point in the history
  • Loading branch information
radare committed Jul 11, 2024
1 parent 1c44d76 commit 3eb574c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
9 changes: 4 additions & 5 deletions python/r2pipe/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
> import r2pipe
> r = r2pipe.open("/bin/ls")
> print(r.cmd("pd 10"))
> print(r.cmdj("aoj")[0]['size'])
> r.quit()
> print(r.cmdj("aoj")[0]['size']) > r.quit()
"""

from r2pipe.open_sync import open
Expand All @@ -31,15 +30,15 @@
except ImportError:
r2lang = None

VERSION = "1.9.3"
VERSION = "1.9.4"

def in_r2():
"""Return wheter r2pipe is called from radare2 environment or the system shell
"""
try:
import os
a = int(os.environ["R2PIPE_IN"]),
b = int(os.environ["R2PIPE_OUT"]),
a = int(os.environ["R2PIPE_IN"])
b = int(os.environ["R2PIPE_OUT"])
return a > 0 and b > 0
except:
return False
Expand Down
4 changes: 2 additions & 2 deletions python/r2pipe/open_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ def in_r2():
"""
try:
import os
a = int(os.environ["R2PIPE_IN"]),
b = int(os.environ["R2PIPE_OUT"]),
a = int(os.environ["R2PIPE_IN"])
b = int(os.environ["R2PIPE_OUT"])
return a > 0 and b > 0
except:
return False
Expand Down

0 comments on commit 3eb574c

Please sign in to comment.