Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _call_location(self, call):
try:
source_file = next(
sf
for sf in self.package.source_files
if sf.path == call.file)
except StopIteration:
souce_file = None
function = call.function
if function:
function = function.name
return Location(self.package, file=source_file, line=call.line,
fun=function)
def _call_location(self, call):
try:
source_file = next(
sf
for sf in self.package.source_files
if sf.path == call.file)
except StopIteration:
souce_file = None
function = call.function
if function:
function = function.name
return Location(self.package, file=source_file, line=call.line,
fun=function)
def _location_from_JSON(self, datum):
try:
pkg = self._get_package(datum["package"])
sf = None
filename = datum["file"]
if filename:
sf = self._get_files(pkg, [filename])[0]
except ValueError:
return None
return Location(pkg, file = sf, line = datum["line"],
fun = datum["function"], cls = datum["class"])
def location(self):
return Location(self.package)
def location(self):
return Location(self.package, file=self)
def location(self):
return Location(self)