Python Forum
import module with syntax error
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
import module with syntax error
#1
i'm importing a module that may have errors in the source code. i tried to catch it like:
try:
    import flaky
except ImportError:
    print('bad module')
but it gave me SyntaxError instead. ImportError didn't cover it. how can i find all the exceptions i might need to cover?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Messages In This Thread
import module with syntax error - by Skaperen - Jun-21-2021, 10:56 PM
RE: import module with syntax error - by bowlofred - Jun-21-2021, 11:41 PM
RE: import module with syntax error - by Skaperen - Jun-22-2021, 02:39 AM
RE: import module with syntax error - by bowlofred - Jun-22-2021, 03:42 AM
RE: import module with syntax error - by buran - Jun-22-2021, 04:50 AM
RE: import module with syntax error - by bowlofred - Jun-22-2021, 06:52 AM
RE: import module with syntax error - by Skaperen - Jun-22-2021, 10:35 AM
RE: import module with syntax error - by Skaperen - Jun-22-2021, 10:38 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  World Clock syntax error OscarBoots 1 243 May-03-2024, 05:20 AM
Last Post: snippsat
  Syntax error for "root = Tk()" dlwaddel 15 1,391 Jan-29-2024, 12:07 AM
Last Post: dlwaddel
Photo SYNTAX ERROR Yannko 3 469 Jan-19-2024, 01:20 PM
Last Post: rob101
  is import cointegration_analysis a recognized module mitcht33 1 479 Nov-06-2023, 09:29 PM
Last Post: deanhystad
  problem in import module from other folder akbarza 5 1,590 Sep-01-2023, 07:48 AM
Last Post: Gribouillis
  can not import anaconda pandas module. PySpark pandas module is imported!! aupres 0 755 Aug-06-2023, 01:09 AM
Last Post: aupres
  Error on import: SyntaxError: source code string cannot contain null bytes kirkwilliams2049 7 7,291 Aug-03-2023, 06:00 PM
Last Post: Gribouillis
  Syntax error while executing the Python code in Linux DivAsh 8 1,792 Jul-19-2023, 06:27 PM
Last Post: Lahearle
  Code is returning the incorrect values. syntax error 007sonic 6 1,319 Jun-19-2023, 03:35 AM
Last Post: 007sonic
  syntax error question - string mgallotti 5 1,388 Feb-03-2023, 05:10 PM
Last Post: mgallotti

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020