parshios.getparsha_string(): Parsha variable is referenced before assignment.
Closed this issue · 2 comments
mhornbacher commented
Good morning,
I noticed an issue with the new update:
Steps to Reproduce:
- Install the latest version of the package.
- Load up a python console
2.5. Import the library (from pyluach import dates, parshios, hebrewcal
) - Create a today variable (e.g.
today = dates.HebrewDate.today()
) - Call the function e.g.
parshios.getparsha_string(today)
Expected Behavior:
Returns a string of the parsha
Actual Behavior:
Throws the following error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/menachem/.local/lib/python3.5/site-packages/pyluach/parshios.py", line 137, in getparsha_string
if parsha is None:
UnboundLocalError: local variable 'parsha' referenced before assignment
Proposed Solution:
Move line 139 above line 137 so that parsha
is assigned before the check.
Notes
Already fixed in dev
branch
Line location:
Line 137 in 00f415f
simlist commented
Thank you for pointing that out. I forgot to merge that fix.
mhornbacher commented
Your welcome. Chag Sameach!