Skip to content

Commit

Permalink
18423 source view
Browse files Browse the repository at this point in the history
  • Loading branch information
arthanson committed Feb 19, 2025
1 parent 3f63e03 commit dad7637
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions netbox/extras/scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,9 +403,12 @@ def source(self):
# classes.
object = self.__class__

lines, lnum = self.findsource(object)
lines = inspect.getblock(lines[lnum:])
return ''.join(lines)
try:
lines, lnum = self.findsource(object)
lines = inspect.getblock(lines[lnum:])
return ''.join(lines)
except OSError:
return ''

@classmethod
def _get_vars(cls):
Expand Down

0 comments on commit dad7637

Please sign in to comment.