Skip to content

Commit

Permalink
Expose the .in_rlang() method
Browse files Browse the repository at this point in the history
  • Loading branch information
radare committed May 28, 2024
1 parent 414ea9f commit 229a19a
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions python/r2pipe/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,18 @@

VERSION = "1.8.8"

def inr2():
def in_r2():
"""Return wheter r2pipe is called from radare2 environment or the system shell
"""
import os
a = int(os.environ["R2PIPE_IN"]),
b = int(os.environ["R2PIPE_OUT"]),
return a > 0 and b > 0
try:
import os
a = int(os.environ["R2PIPE_IN"]),
b = int(os.environ["R2PIPE_OUT"]),
return a > 0 and b > 0
except:
return False

from r2pipe.open_base import in_rlang

def version():
"""Return string with the version of the r2pipe library
Expand Down

0 comments on commit 229a19a

Please sign in to comment.